Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle native libraries not found on device but present in apk

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 plugged in from jCenter). But on Android 5.1 Here SDK throws exception "MISSING LIBRARIES: libMAPSJNI.so" although this library present in result APK. I opened folder where my program is installed on device and compared content in two cases: with or without Twilio SDK. The difference is that when connected Twilio API folder /lib is a file, and for obvious reasons, the loader can not see inside it native libraries needed initialize Here SDK. If remove the Twilio gradle dependency the assembly occurs normally. What could be a reason and how to fix it? If needed I can attach test project with these libs

like image 694
ibogolyubskiy Avatar asked Aug 18 '16 14:08

ibogolyubskiy


1 Answers

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.

like image 85
Artem Nikitin Avatar answered Oct 19 '22 17:10

Artem Nikitin