首页 / 浏览问题 / 移动GIS / 问题详情
imobile-10.2.1-228适配小米平板5吗
58EXP 2022年08月26日
如下:我之前的板子没问题,一用到小米平板5就报错   --------- beginning of crash
2022-08-26 09:47:27.674 15782-15782/com.example.jstifieldconnection E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.jstifieldconnection, PID: 15782
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.jstifieldconnection/com.example.jstifieldconnection.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'char[] java.lang.String.toCharArray()' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3586)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3746)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2166)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:236)
        at android.app.ActivityThread.main(ActivityThread.java:8164)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'char[] java.lang.String.toCharArray()' on a null object reference
        at com.supermap.data.Environment.encryptionMac(Environment.java:2283)
        at com.supermap.data.Environment.writeFile(Environment.java:2312)
        at com.supermap.data.Environment.checkDevice_New(Environment.java:836)
        at com.supermap.data.Environment.initialization(Environment.java:626)
        at com.example.jstifieldconnection.MainActivity.onCreate(MainActivity.java:155)
        at android.app.Activity.performCreate(Activity.java:8247)
        at android.app.Activity.performCreate(Activity.java:8218)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3559)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3746)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2166)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:236)
        at android.app.ActivityThread.main(ActivityThread.java:8164)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

1个回答

您好,根据您的描述,

1.请问下MainActivity.onCreate(MainActivity.java:155)这里的代码是什么呢,麻烦您贴出来下方便我判断呢

2.请问您的工程build.gradle里面defaultConfig节点下面有没有添加

ndk{
    abiFilters "armeabi-v7a"
}

3.请问您的工程gradle插件版本是多少呢,建议不要高于7

4.请问您的平板系统是多少呢

5.您可以在断点中查看一下许可状态以及许可路径

3,690EXP 2022年08月26日

1 这是155行代码

//初始化
Environment.initialization(this);

2 build.gradle里面defaultConfig节点下面的ndk添加了

3 gradle插件版本4.2.3

4  平板系统安卓11

5 许可状态和路径没问题

已解决,是因为小米手机的读写权限问题造成的
...