Gradle native libraries not found on device but present in apk

前端 未结 2 1382
我寻月下人不归
我寻月下人不归 2020-12-06 20:32

My application uses Here SDK and Twilio SDK. Both uses native libraries (Here SDK with native libraries locally plugged in from /libs and /jniLibs folders, Twilio SDK plugge

相关标签:
2条回答
  • 2020-12-06 20:45

    By defining a splits block you can tell Gradle to create APKs for each listed ABI:

    include "armeabi", "armeabi-v7a", "x86", "mips"
    

    Alternatively you can include all desired ABIs into one APK by adding the following filter:

    android {
    (...)
    defaultConfig {
        (...)
        ndk {
            // allow only 32bit *.so libs
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
    }
    

    }

    Both approaches will exclude 64bit functionality that might clash with the 32bit HERE SDK, but the latter will support more devices with a single APK.

    Some libraries, like the new Android Room Persistence library, add 32bit flavors along with the two 64bit ABI flavors arm64-v8a and x86_64. Since HERE SDK at the moment only provides a 32bit lib it should be safe to exclude 64bit lib variants. On the other hand it is expected that 64bit devices can gracefully handle 32bit libs.

    0 讨论(0)
  • 2020-12-06 20:58

    You need to modify your build.gradle like this:

    android {
        (...)
        splits {
            abi {
                enable true
                reset()
                include 'armeabi-v7a'
                universalApk false
            }
        }
        (...)
    }
    

    It's probably because Twilio SDK supports x86 and HERE SDK currently doesn't support it.

    0 讨论(0)
提交回复
热议问题