2

When running my android application Android Studio prints error:

Error:Execution failed for task ':app:processAndroidArmDebugJniLibs'.
> java.io.FileNotFoundException: <path here>\distribution\wb\lib\x86\libwb.so (The system cannot find the path specified)

It tries to access x86 library but I tried to limit target platforms only to arm platform. Error is gone if I replace ${targetPlatform.getName()} with armeabi in app.gradle (gradle-experimental) file:

model {
repositories {
    libs(PrebuiltLibraries) {
        wb {
            binaries.withType(SharedLibraryBinary) {
                sharedLibraryFile = file("${lib_distribution_root}/wb/lib/${targetPlatform.getName()}/libwb.so")
            }
        }
    }
}
android {
    // ...
    sources {
        main {
            jniLibs {
                dependencies {
                    library "wb"
                }
            }
        }
    }
    productFlavors {
        create("arm") {
            ndk.abiFilters.add("armeabi")
        }
    }
}
// ...

How to fix build so that only arm library is used?

jozols
  • 560
  • 7
  • 22

1 Answers1

0

You can add ndk.abiFilters in build.gradle:


    android {
        ....
        defaultConfig {
        ndk {
            abiFilters 'armeabi'
            }
        }
        ....
    }
Cruise Hung
  • 82
  • 11
  • I don't know if this worked in gradle-experimental, but I switched to stable gradle for some time ago. I think most of people don't use gradle-experimental anymore. – jozols Sep 19 '17 at 10:39