我有一个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配置?
upd:答案在这里un4seen.com/forum/?topic=15633.msg110256#msg110256
最佳答案
以下解决方案来自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