首页 / 浏览问题 / 移动GIS / 问题详情
imobile开发二维移动GIS时,无法打开地图,直接闪退
8EXP 2024年07月26日

稍作修改,但原代码也是同样错误。

1个回答

麻烦贴出完整的报错信息,帮助定位问题
3,685EXP 2024年07月26日
2024-07-26 16:26:06.125 30221-30221/com.example.pocket_park A/ple.pocket_park: runtime.cc:692]   at void android.os.Parcel.readException(int, java.lang.String) (Parcel.java:3038)
    runtime.cc:692]   at void android.os.Parcel.readException() (Parcel.java:2980)
    runtime.cc:692]   at android.net.wifi.WifiInfo android.net.wifi.IWifiManager$Stub$Proxy.getConnectionInfo(java.lang.String, java.lang.String) (IWifiManager.java:5624)
    runtime.cc:692]   at android.net.wifi.WifiInfo android.net.wifi.WifiManager.getConnectionInfo() (WifiManager.java:4390)
    runtime.cc:692]   at void com.supermap.data.Environment.jni_JniLoading(android.content.Context) (Environment.java:-2)
    runtime.cc:692]   at boolean com.supermap.data.Environment.initialization(android.content.Context) (Environment.java:632)
    runtime.cc:692]   at void com.example.pocket_park.function.lead.LeadActivity.onCreate(android.os.Bundle) (LeadActivity.java:45)
    runtime.cc:692]   at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:8964)
    runtime.cc:692]   at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:8921)
    runtime.cc:692]   at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1456)
    runtime.cc:692]   at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:4287)
    runtime.cc:692]   at android.app.Activity android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.app.servertransaction.PendingTransactionActions, int, android.content.Intent) (ActivityThread.java:4459)
    runtime.cc:692]   at void android.app.servertransaction.LaunchActivityItem.execute(android.app.ClientTransactionHandler, android.os.IBinder, android.app.servertransaction.PendingTransactionActions) (LaunchActivityItem.java:103)
    runtime.cc:692]   at void android.app.servertransaction.TransactionExecutor.executeCallbacks(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:139)
    runtime.cc:692]   at void android.app.servertransaction.TransactionExecutor.execute(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:96)
    runtime.cc:692]   at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:2855)
    runtime.cc:692]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:108)
    runtime.cc:692]   at boolean android.os.Looper.loopOnce(android.os.Looper, long, int) (Looper.java:226)
    runtime.cc:692]   at void android.os.Looper.loop() (Looper.java:328)
    runtime.cc:692]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:9236)
    runtime.cc:692]   at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
    runtime.cc:692]   at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:594)
    runtime.cc:692]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1099)
    runtime.cc:692]
2024-07-26 16:26:06.125 30221-30221/com.example.pocket_park A/ple.pocket_park: runtime.cc:700] JNI DETECTED ERROR IN APPLICATION: JNI GetObjectClass called with pending exception java.lang.SecurityException: WifiService: Neither user 10417 nor current process has android.permission.ACCESS_WIFI_STATE.
    runtime.cc:700]   at java.lang.Exception android.os.Parcel.createExceptionOrNull(int, java.lang.String) (Parcel.java:3071)
    runtime.cc:700]   at java.lang.Exception android.os.Parcel.createException(int, java.lang.String) (Parcel.java:3055)
    runtime.cc:700]   at void android.os.Parcel.readException(int, java.lang.String) (Parcel.java:3038)
    runtime.cc:700]   at void android.os.Parcel.readException() (Parcel.java:2980)
    runtime.cc:700]   at android.net.wifi.WifiInfo android.net.wifi.IWifiManager$Stub$Proxy.getConnectionInfo(java.lang.String, java.lang.String) (IWifiManager.java:5624)
    runtime.cc:700]   at android.net.wifi.WifiInfo android.net.wifi.WifiManager.getConnectionInfo() (WifiManager.java:4390)
    runtime.cc:700]   at void com.supermap.data.Environment.jni_JniLoading(android.content.Context) (Environment.java:-2)
    runtime.cc:700]   at boolean com.supermap.data.Environment.initialization(android.content.Context) (Environment.java:632)
    runtime.cc:700]   at void com.example.pocket_park.function.lead.LeadActivity.onCreate(android.os.Bundle) (LeadActivity.java:45)
    runtime.cc:700]   at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:8964)
    runtime.cc:700]   at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:8921)
    runtime.cc:700]   at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1456)
    runtime.cc:700]   at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:4287)
    runtime.cc:700]   at android.app.Activity android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.app.servertransaction.PendingTransactionActions, int, android.content.Intent) (ActivityThread.java:4459)
    runtime.cc:700]   at void android.app.servertransaction.LaunchActivityItem.execute(android.app.ClientTransactionHandler, android.os.IBinder, android.app.servertransaction.PendingTransactionActions) (LaunchActivityItem.java:103)
    runtime.cc:700]   at void android.app.servertransaction.TransactionExecutor.executeCallbacks(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:139)
    runtime.cc:700]   at void android.app.servertransaction.TransactionExecutor.execute(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:96)
    runtime.cc:700]   at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:2855)
    runtime.cc:700]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:108)
    runtime.cc:700]   at boolean android.os.Looper.loopOnce(android.os.Looper, long, int) (Looper.java:226)
    runtime.cc:700]   at void android.os.Looper.loop() (Looper.java:328)
    runtime.cc:700]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:9236)
    runtime.cc:700]   at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
    runtime.cc:700]   at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:594)
    runtime.cc:700]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1099)
    runtime.cc:700]
    runtime.cc:700]     in call to GetObjectClass
    runtime.cc:700]     from void com.supermap.data.Environment.jni_JniLoading(android.content.Context)

根据报错信息可以确定请注意以下几点
1.app模块的build.gradle配置文件中是否有添加ndk,如

ndk {
    abiFilters 'arm64-v8a'  'armeabi-v7a'
}

2..安卓sdk由于安全策略变更,sdk 28之后的版本只能访问应用沙盒路径,如果使用的sdk版本高于28,文件许可应该放到对应应用的沙盒路径下

...