首页 / 浏览问题 / 移动GIS / 问题详情
mapview使用报jni崩溃
27EXP 2018年07月04日

07-04 14:39:17.475 11576-11576/com.gq.riverchiefs A/art: art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: JNI GetObjectClass called with pending exception java.lang.NoSuchMethodError: no non-static method "Lcom/supermap/mapping/MapControl2;.taskRefreshCallBack(Z)V"
    art/runtime/java_vm_ext.cc:410]   at void com.supermap.mapping.MapControl2Native.jni_SetAction(long, int, int) (MapControl2Native.java:-2)
    art/runtime/java_vm_ext.cc:410]   at void com.supermap.mapping.MapControl2.setAction(com.supermap.mapping.Action) (MapControl2.java:880)
    art/runtime/java_vm_ext.cc:410]   at void com.supermap.mapping.MapControl2.a(android.content.Context, com.supermap.data.Workspace) (MapControl2.java:263)
    art/runtime/java_vm_ext.cc:410]   at void com.supermap.mapping.MapControl2.<init>(android.content.Context, com.supermap.data.Workspace) (MapControl2.java:247)
    art/runtime/java_vm_ext.cc:410]   at void com.supermap.mapping.MapControl2.<init>(android.content.Context) (MapControl2.java:242)
    art/runtime/java_vm_ext.cc:410]   at void com.supermap.mapping.MapControl.a(android.content.Context) (MapControl.java:62)
    art/runtime/java_vm_ext.cc:410]   at void com.supermap.mapping.MapControl.<init>(android.content.Context) (MapControl.java:33)
    art/runtime/java_vm_ext.cc:410]   at void com.supermap.mapping.MapView.a(android.content.Context) (MapView.java:91)
    art/runtime/java_vm_ext.cc:410]   at void com.supermap.mapping.MapView.<init>(android.content.Context, android.util.AttributeSet) (MapView.java:82)
    art/runtime/java_vm_ext.cc:410]   at java.lang.Object java.lang.reflect.Constructor.newInstance!(java.lang.Object[]) (Constructor.java:-2)
    art/runtime/java_vm_ext.cc:410]   at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:619)
    art/runtime/java_vm_ext.cc:410]   at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:764)
    art/runtime/java_vm_ext.cc:410]   at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:704)
    art/runtime/java_vm_ext.cc:410]   at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:835)
07-04 14:39:17.476 11576-11576/com.gq.riverchiefs A/art: art/runtime/java_vm_ext.cc:410]   at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:798)
    art/runtime/java_vm_ext.cc:410]   at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:838)
    art/runtime/java_vm_ext.cc:410]   at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:798)
    art/runtime/java_vm_ext.cc:410]   at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:515)
    art/runtime/java_vm_ext.cc:410]   at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:423)
    art/runtime/java_vm_ext.cc:410]   at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:374)
    art/runtime/java_vm_ext.cc:410]   at void android.support.v7.app.AppCompatDelegateImplV9.setContentView(int) (AppCompatDelegateImplV9.java:287)
    art/runtime/java_vm_ext.cc:410]   at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:139)
    art/runtime/java_vm_ext.cc:410]   at void com.gq.riverchiefs.ui.MainActivity.initContentView(android.os.Bundle) (MainActivity.java:103)
    art/runtime/java_vm_ext.cc:410]   at void com.gq.riverchiefs.base.BaseActivity.onCreate(android.os.Bundle) (BaseActivity.java:20)
    art/runtime/java_vm_ext.cc:410]   at void com.gq.riverchiefs.ui.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:83)
    art/runtime/java_vm_ext.cc:410]   at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6251)
    art/runtime/java_vm_ext.cc:410]   at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1107)
    art/runtime/java_vm_ext.cc:410]   at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2369)
    art/runtime/java_vm_ext.cc:410]   at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2476)
    art/runtime/java_vm_ext.cc:410]   at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:-1)
    art/runtime/java_vm_ext.cc:410]   at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1344)
    art/runtime/java_vm_ext.cc:410]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
    art/runtime/java_vm_ext.cc:410]   at void android.os.Looper.loop() (Looper.java:148)
    art/runtime/java_vm_ext.cc:410]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:5417)
    art/runtime/java_vm_ext.cc:410]   at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
    art/runtime/java_vm_ext.cc:410]   at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:726)
    art/runtime/java_vm_ext.cc:410]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:616)
    art/runtime/java_vm_ext.cc:410] 
    art/runtime/java_vm_ext.cc:410]     in call to GetObjectClass
    art/runtime/java_vm_ext.cc:410]     from void com.supermap.mapping.MapControl2Native.jni_SetAction(long, int, int)
    art/runtime/java_vm_ext.cc:410] "main" prio=5 tid=1 Runnable
    art/runtime/java_vm_ext.cc:410]   | group="main" sCount=0 dsCount=0 obj=0x732962a0 self=0xb4df6500
    art/runtime/java_vm_ext.cc:410]   | sysTid=11576 nice=0 cgrp=default sched=0/0 handle=0xb6fe5b34
    art/runtime/java_vm_ext.cc:410]   | state=R schedstat=( 1423341503 29726980 459 ) utm=118 stm=24 core=1 HZ=100
    art/runtime/java_vm_ext.cc:410]   | stack=0xbe2ca000-0xbe2cc000 stackSize=8MB
    art/runtime/java_vm_ext.cc:410]   | held mutexes= "mutator lock"(shared held)
    art/runtime/java_vm_ext.cc:410]   native: #00 pc 00370e01  /system/lib/libart.so 

版本supermap-imobile-9.0.1-103-android-zip-chs 其他代码和配置都和guide里一致
运行后在setContentView()的时候崩溃了
手机系统:6.0.1 机型:Nexus 5 开发环境:Android Studio 3.1.3

2 个回答


这是剩下的部分log

27EXP 2018年07月04日
好像是jni调用代码有误 请问超图 什么时候能解决
27EXP 2018年07月04日
超图哥哥不容易,要会移动端、要会桌面端、要会云端、要会web端·····

找到原因了 如果开启了混淆
需要添加混淆:

-keep class com.supermap.** { *;}
-keep class com.github.** { *;}
我今天也遇到这个问题了,不过我是通过自己写的demo,在编译服务器编的,so库也是调不到,你解决了吗
我的这个问题不算so库找不到 是因为jar包被混淆了 所以超图源码调用so库的方法调用异常
我不知道你的问题是什么 因为编译环境配置不太一样
...