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

来源:互联网 发布:sql delete语句返回值 编辑:程序博客网 时间:2024/05/18 22:12

出错的地方是在:

<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的调用地址。

希望对读者有一定的帮助,有什么问题可随时跟我留言。谢谢

1 0
原创粉丝点击