Android project crash when AAR library is added

Hello guys!

I’m trying to add Pocketsphinx library to an android project by adding the line into “build.gradle” file:
dependencies {
compile fileTree(dir: ‘libs’, include: [’*.jar’])
compile project(’:deps:extension-api’)
compile project(’:pocketsphinx-android-5prealpha-release’)
}

But when I try to build APK I get the error:

SDL Error

An error occured while trying to start the application. Please try again and/ or reinstall.

Error: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/org.openfl.samples.displayingabitmap-2/base.apk”],nativeLibraryDirectories=[/data/app/org.openfl.samples.displayingabitmap-2/lib/arm64, /system/fake-libs64, /data/app/org.openfl.samples.displayingbitmap-2/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn’t find “liblime.so”

The error occurs only if the library is added. If I delete the line:

compile project(’:pocketsphinx-android-5prealpha-release’)

everything works okey

Could you please give me any advise why this could happen?

P.S. Sorry for bad English :slight_smile:

Hmm, curious, I wonder why it cannot find liblime.so anymore, maybe it is expecting a different architecture?

We haven’t added ARM64 support on Android yet, it could be looking for that?

Yes, it is. Android Studio was confused when detect that Pocketsphinx library has ARM64 version and built whole project under ARM64 architecture. I’ve just remove arm64 files from Pocketsphinx library and it seems it works fine now. Thank you!

1 Like