mapview报InflateException

0 投票

使用SuperMap iMobile 8C(2017) SP1 for Android_811a_10230

Caused by: android.view.InflateException: Binary XML file line #63: Binary XML file line #63: Error inflating class com.supermap.mapping.MapView
        at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at com.gq.riverchiefs.ui.MainActivity.initContentView(MainActivity.java:92)
        at com.gq.riverchiefs.base.BaseActivity.onCreate(BaseActivity.java:20)
        at com.gq.riverchiefs.ui.MainActivity.onCreate(MainActivity.java:78)
        at android.app.Activity.performCreate(Activity.java:6251)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:148) 
        at android.app.ActivityThread.main(ActivityThread.java:5417) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
     Caused by: android.view.InflateException: Binary XML file line #63: Error inflating class com.supermap.mapping.MapView
        at android.view.LayoutInflater.createView(LayoutInflater.java:645)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 

......
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/supermap/mapping/g;
        at com.supermap.mapping.MapControl2.<clinit>(MapControl2.java:43)
        at com.supermap.mapping.MapControl.a(MapControl.java:55)
        at com.supermap.mapping.MapControl.<init>(MapControl.java:29)
        at com.supermap.mapping.MapView.a(MapView.java:82)
        at com.supermap.mapping.MapView.<init>(MapView.java:73)
        at java.lang.reflect.Constructor.newInstance(Native Method) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)

编译成功 真机上运行报错 代码和示例代码一致 地图未成功显示过 

        String rootPath = "/sdcard";
        Environment.setLicensePath(rootPath + "/SuperMap/license/");
        Environment.setTemporaryPath(rootPath + "/SuperMap/temp/");
        Environment.setWebCacheDirectory(rootPath + "/SuperMap/WebCache/");
        Environment.initialization(this);
        setContentView(R.layout.activity_main);

7月 3, 2018 分类:  186次浏览 | 用户: riverchiefs2018 初出茅庐 (27 分)

1个回答

0 投票
你好,这类问题可以从以下排查:

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

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

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

4、使用的iMobile的jar和依赖库和许可是否同一个版本。
7月 4, 2018 用户: 王国新 名扬四海 (1,932 分)
...