首页 / 浏览问题 / 移动GIS / 问题详情
按照文档加载地图错误
54EXP 2019年11月18日

运行到这一步闪退, 权限也全部允许了

然后日志

我的文件路径都没错,许可也在有效期

1个回答

您好,在Android6.0版本后需要设置动态权限,您那边有对手机的读写设置权限吗?可以调试一下看是否能获取设备下的文件
9,232EXP 2019年11月18日
权限全部允许了
您那边能否提供一下详细的报错信息,然后打印输出一下能否获取设备中的文件

结果:

E/11111: /storage/emulated/0/SuperMap/license/
E/22222: /storage/emulated/0/SuperMap/temp/
E/33333: /storage/emulated/0/SuperMap/WebCatch

错误:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.haiyin, PID: 10620
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.haiyin/com.example.haiyin.map_SN}: java.lang.NullPointerException: Attempt to get length of null array
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
     Caused by: java.lang.NullPointerException: Attempt to get length of null array
        at com.supermap.data.Environment.checkAndLoadLibrary64(Environment.java:1661)
        at com.supermap.data.Environment.initialization(Environment.java:580)
        at com.example.haiyin.map_SN.onCreate(map_SN.java:37)
        at android.app.Activity.performCreate(Activity.java:7224)
        at android.app.Activity.performCreate(Activity.java:7213)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

是什么原因导致的?

您这个报错是由于我们目前提供的包暂时不支持64位库,需要您在在grandle中设置ndk。

ndk{
    abiFilters 'armeabi-v7a','armeabi'
}
是在model里的grandle还是在外面的grandle,具体哪个位置?

model里面的grandle,写在defaultConfig节点下,可以参考一下这篇博客:;https://blog.csdn.net/yao_94/article/details/79151804

加了你给的这段代码还是保同样的错,
设置ndk的时候只需要设置你所加的so库的文件夹名称,如armeabi-v7a
好的,成功了,谢谢
...