문제 설명
64비트 Android 장치에서 .so 파일을 찾을 수 없습니다. (Can not find .so file on 64 bit android device)
android studio 및 gradle 빌드를 사용하여 새장 android sdk 사용. 32비트 아키텍처를 사용하는 모든 기기에서 정상적으로 실행되는 앱이 생성되었습니다.
64비트 기기에서 동일한 앱에서 다음 오류가 발생합니다. [예. Sony C4]
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file
"/data/app/com.myapp/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libaviary_moalite.so"
gredle.build 부분
dependencies {
...
compile 'com.android.support:multidex:1.0.0'
compile 'com.facebook.fresco:fresco:0.8.1+'
compile 'com.facebook.fresco:imagepipeline‑okhttp:0.8.1+'
compile 'com.android.support:appcompat‑v7:22.2.1'
compile 'com.adobe.creativesdk:image:4.0.0'
}
작동하지 않은 참조
ARM64 NDK 네이티브를 찾을 수 없습니다. Android Studio(1.3 RC)를 사용하는 lib
사용된 솔루션을 사용하면 동일한 오류가 발생합니다.
참조 솔루션
방법 1:
It looks like some of the packages you use come with 64‑bit libraries, but some don't. To keep your APK 32‑bit only, I use
android {
splits {
abi {
enable true
reset()
include 'armeabi‑v7a'
}
}
}
You can play with include 'armeabi'
too, if it is relevant.
방법 2:
I've solved this case by the following steps:
I've moved armeabi and x86 folders from: \src\main\jniLibs to: \libs
Please make sure to move all the files under those folders as well: *.so files should be located there.
I've added the following to my build.gradle:
sourceSets.main { jniLibs.srcDir 'src/main/libs' }
Clean + rebuild the project
*in case you are using multidex, please verify that these lines were added to build.gradle:
defaultConfig { multiDexEnabled true } dexOptions { preDexLibraries false javaMaxHeapSize "4g" }
In addition, this should be added inside your manifest file:
<application
android:name="android.support.multidex.MultiDexApplication">
/application>
Hope this helps.
(by Umesh Aawte、Alex Cohn、user5993310)