使用产品:Android studio 2022.2、SuperMap iMobile 11i(2022) SP1 for Android 操作系统:win11 x64
问题详细描述:该项目是移动GIS课程中的示范,项目可成功运行,但虚拟机中应用闪退,点击调试显示以下内容
下载的JDK版本为7u80,系统环境变量已设置
库文件和依赖文件设置完成
虚拟机中也已经拷贝入许可和数据
用了真机调试,还是闪退,说由于自身空指针异常造成,下面是问题trace
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.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:3771) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3938) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 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:2318) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:210) at android.os.Looper.loop(Looper.java:299) at android.app.ActivityThread.main(ActivityThread.java:8306) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1073) 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.test.MainActivity.onCreate(MainActivity.java:24) at android.app.Activity.performCreate(Activity.java:8194) at android.app.Activity.performCreate(Activity.java:8160) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3744) ... 12 more