首页 / 浏览问题 / 移动 / 问题详情
配置supermap之后运行app闪退Android studio提示错误
3月14
E/AndroidRuntime: FATAL EXCEPTION: main

    Process: com.example.travel, PID: 5781

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.travel/com.example.travel.MainActivity}: android.view.InflateException: Binary XML file line #9 in com.example.travel:layout/activity_main: Binary XML file line #9 in com.example.travel:layout/activity_main: Error inflating class com.supermap.mapping.MapView

        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3577)

        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3749)

        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:2181)

        at android.os.Handler.dispatchMessage(Handler.java:106)

        at android.os.Looper.loop(Looper.java:236)

        at android.app.ActivityThread.main(ActivityThread.java:8090)

        at java.lang.reflect.Method.invoke(Native Method)

        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)

        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011)

     Caused by: android.view.InflateException: Binary XML file line #9 in com.example.travel:layout/activity_main: Binary XML file line #9 in com.example.travel:layout/activity_main: Error inflating class com.supermap.mapping.MapView

     Caused by: android.view.InflateException: Binary XML file line #9 in com.example.travel:layout/activity_main: Error inflating class com.supermap.mapping.MapView

     Caused by: java.lang.reflect.InvocationTargetException

        at java.lang.reflect.Constructor.newInstance0(Native Method)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)

        at android.view.LayoutInflater.createView(LayoutInflater.java:856)

        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1012)

        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:963)

        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1142)

        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1103)

        at android.view.LayoutInflater.inflate(LayoutInflater.java:684)

        at android.view.LayoutInflater.inflate(LayoutInflater.java:536)

        at android.view.LayoutInflater.inflate(LayoutInflater.java:479)

        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)

        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)

        at com.example.travel.MainActivity.onCreate(MainActivity.java:17)

        at android.app.Activity.performCreate(Activity.java:8142)

        at android.app.Activity.performCreate(Activity.java:8114)

        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)

        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3550)

        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3749)

        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:2181)

        at android.os.Handler.dispatchMessage(Handler.java:106)

        at android.os.Looper.loop(Looper.java:236)

        at android.app.ActivityThread.main(ActivityThread.java:8090)

        at java.lang.reflect.Method.invoke(Native Method)

        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)

        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011)

     Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libimb.so" not found

        at java.lang.Runtime.loadLibrary0(Runtime.java:1087)

        at java.lang.Runtime.loadLibrary0(Runtime.java:1008)

        at java.lang.System.loadLibrary(System.java:1664)

        at com.supermap.data.Environment.LoadWrapJ(Environment.java:467)

        at com.supermap.data.Environment.InternalLoadWrapJ(Environment.java:1216)

        at com.supermap.mapping.i.a(InternalEnvironment.java:22)

        at com.supermap.mapping.MapControl2.<clinit>(MapControl2.java:63)

        at com.supermap.mapping.MapControl.a(MapControl.java:87)

        at com.supermap.mapping.MapControl.<init>(MapControl.java:58)

        at com.supermap.mapping.MapView.a(MapView.java:95)

        at com.supermap.mapping.MapView.<init>(MapView.java:86)

        ... 28 more

1个回答

你好,看报错是依赖的问题,您的工程是否有引入so依赖以及gradle中jar包是否引入呢?
张亮  (2,842分)  名扬四海
3月14
你好,我引入了依赖和jar包
你好,这类问题可以从以下排查:

1、iMobile for Android的环境配置是否正确;

2、使用许可要有效,且能获取到移动设备中的许可文件,即要有读取的权限;

3、移动设备的系统时间是否正确,即是否显示当天,如果不是设置一下系统时间;

4、使用的iMobile的jar和依赖库和许可是否同一个版本。

5、检查您的layout布局是否正确,参考samplecode里面的布局代码。
...