您的位置:首页 > 移动开发 > Android开发

android studio处理百度定位异常 no found the liblocSDK4d.so file, please correct settings

2015-07-02 13:35 741 查看
出错的地方是在:

<span style="font-size:24px;"> static {
try {
System.loadLibrary("locSDK5");
} catch (UnsatisfiedLinkError var1) {
var1.printStackTrace();
af = true;
throw new IllegalStateException("no found the liblocSDK4d.so file, please correct settings");
}
}</span>


Jni调用时出错的。该代码在eclipse上运行时没有问题的,但是到android studio上就会报 no found the liblocSDK4d.so file, please correct settings异常。原因是找不到locaSDK5..但是我们明明添加了liblocalSDk5文件,为什么会搜索不到呢?解决方法如下:

1.检查localSDK5.so是否在armeabi文件夹下

2.就是我们最容易忽视的地方build.gradle文件

<span style="font-size:24px;"> sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}</span>
确定是否配置了jni的调用地址。

希望对读者有一定的帮助,有什么问题可随时跟我留言。谢谢
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: