无法找到64位Android设备上.so文件 [英] Can not find .so file on 64 bit android device
问题描述
使用百鸟Android SDK中采用了android工作室打造的gradle。
生成的应用程序上运行具有32位架构的所有设备的罚款。
Using aviary android sdk using android studio and gradle build. App generated running fine on all devices having 32 bit architecture.
相同的应用程序是给在64位设备[例如下面的错误。索尼C4]
Same app is giving following error in the 64 bit device [Eg. 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'
}
引用不工作
<一个href=\"http://stackoverflow.com/questions/31645562/cant-find-arm64-ndk-native-lib-using-android-studio-1-3-rc\">Can't采用Android工作室找到ARM64 NDK本地库(1.3 RC)
同样的错误,如果使用任何使用的解决方案。
Same error if use any of solution used.
<一个href=\"http://stackoverflow.com/questions/30782848/how-to-use-32-bit-native-libaries-on-64-bit-android-device\">How在64位的Android设备使用32位本机libaries
How to use 32-bit native libaries on 64-bit Android device
获取错误,如
Error:(16, 0) Error: NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin. For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental. Set "android.useDeprecatedNdk=true" in gradle.properties to continue using the current NDK integration.
我不知道自己做错了什么,我做的,或者是不支持的。
I am not sure what wrong I am doing or it is not supported at all.
推荐答案
我已经通过以下步骤解决了这个情况:
I've solved this case by the following steps:
-
我搬到armeabi和x86文件夹
来自:\\ SRC \\主\\ jniLibs
于:\\库
I've moved armeabi and x86 folders from: \src\main\jniLibs to: \libs
请务必将所有文件这些文件夹下还有:* .so文件应设在那里
Please make sure to move all the files under those folders as well: *.so files should be located there.
我添加以下到我的build.gradle:
I've added the following to my build.gradle:
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
}
清洁+重建项目
Clean + rebuild the project
*如果你使用的是multidex,请确认添加这些行的build.gradle:
*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>
希望这有助于。
这篇关于无法找到64位Android设备上.so文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!