我有一个android项目(Inellij IDEA)。我从官方网站下载BASS库,并将lib
文件夹中的内容复制到我的项目文件夹libs/
。但是当我尝试使用System.loadLibrary("bass");
加载它时,会抛出错误:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip
file "/data/app/com.negi.opengltest-1/base.apk"],nativeLibraryDirectories=
[/vendor/lib, /system/lib]]] couldn't find "libbass.so"
我做错了什么?也许,我需要更改gradle配置?
答案 0 :(得分:3)
以下解决方案来自http://www.un4seen.com/forum/?topic=15633.msg110256#msg110256:
1 mkdir lib, then, copy armeabi to lib, the tree should be lib/armeeabi/libbass.so
2 zip lib directory: $zip -r libbass.zip lib
3 rename: $mv libbass.zip libbass.jar
4 copy libbass.jar to YourProject/Youproject/src/main/libs ("YourProject/Youproject/src/main/" includes AndroidManifests.xml, res, java, libs)
5 add this line:
compile fileTree(dir: 'libs', include: '*.jar')
to your build.gradle---->dependencies
答案 1 :(得分:-1)
// compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
// transitive = true;
// }
// compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.6@aar') {
// transitive = true;
// }