android使用高德地图出现诡异的:JNI DETECTED ERROR IN APPLICATION

今天用 android studio 写程序踩到这个诡异的坑:


首先介绍使用的开发工具和环境:android studio

测试机型:红米note2: android 5.0.2



是这样的:笔者程序中写的这个页面中上方是一个地图(高德地图),下方是一个listview,展示地图中的相关数据,然后今天要改造这个listview为expandableListViewV,吭哧吭哧写完了,高高兴兴等华丽丽的变化,然而 图样图森破 ,点进这个有地图的页面,显示黑屏,卡了好几秒,直接闪退回登录界面,然后报了下方的错,真是。。。招谁惹谁了。。。对了诡异的事还没说:不管你怎么修改代码,再进来这个页面就是这样了,接下来重点来了,我试着卸载掉这个app,然后重新编译安装,又可以运行地图的界面了,然而,重新随便改下界面的布局,再instance Run一下,爆炸,重复上面的报错了。当然,看报错信息应该跟jni相关,试着换个手机,同样会出现一眼改的问题,然后,试着关闭instance Run ,结果还是老样子(诡异的是之前开发这个界面就没出现过这个情况,so库是高德开放api提供的,且一直没有更换jni放置目录,而且检查data/app/应用包名/lib/arm/编译打包进的so库无异常,猜想是更新了android studio 和gradle?),现在问题还没解决,暂时先在这记录下。(解决了再更新)




08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70] JNI DETECTED ERROR IN APPLICATION: jarray was NULL

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]    in call to GetByteArrayElements

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]    from void com.autonavi.amap.mapcore.MapCore.nativeSetInternaltexture(long, byte[], int)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70] "GLThread 584" prio=5 tid=39 Runnable

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  | group="main" sCount=0 dsCount=0 obj=0x12d60920 self=0xab8a3cc8

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  | sysTid=9417 nice=0 cgrp=default sched=0/0 handle=0xe510f000

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  | state=R schedstat=( 12297768 7041846 75 ) utm=0 stm=1 core=2 HZ=100

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  | stack=0xdfa0c000-0xdfa0e000 stackSize=1036KB

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  | held mutexes= "mutator lock"(shared held)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  native: #00 pc 00004d44  /system/lib/libbacktrace_libc++.so (_ZN13UnwindCurrent6UnwindEjP8ucontext+23)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  native: #01 pc 002440f1  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_6mirror9ArtMethodE+68)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  native: #02 pc 0022981d  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+144)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  native: #03 pc 000b026d  /system/lib/libart.so (_ZN3artL8JniAbortEPKcS1_+556)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  native: #04 pc 000b0985  /system/lib/libart.so (_ZN3art9JniAbortFEPKcS1_z+60)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  native: #05 pc 000b31f5  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckEbPKcz.constprop.141+1812)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  native: #06 pc 000bc27d  /system/lib/libart.so (_ZN3art8CheckJNI20GetByteArrayElementsEP7_JNIEnvP11_jbyteArrayPh+44)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  native: #07 pc 0000a091  /data/app/com.lanqian.skxcpt-1/lib/arm/libgdinamapv4sdk752ex.so (Java_com_autonavi_amap_mapcore_MapCore_nativeSetInternaltexture+20)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  native: #08 pc 000e04b9  /data/data/com.lanqian.skxcpt/cache/slice-AMap_3DMap_V3.3.2_20160525_a1f12488cb9e57a151d80c3b3d4a08c03985fe7b-classes.dex (Java_com_autonavi_amap_mapcore_MapCore_nativeSetInternaltexture__J_3BI+128)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  at com.autonavi.amap.mapcore.MapCore.nativeSetInternaltexture(Native method)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  at com.autonavi.amap.mapcore.MapCore.setInternaltexture(MapCore.java:135)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  at com.amap.api.mapcore.util.u.e(GLMapResManager.java:462)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  at com.amap.api.mapcore.util.c.r(AMapDelegateImp.java:1118)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  - locked <0x2cb31f19> (a com.amap.api.mapcore.util.c)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  at com.amap.api.mapcore.util.c.onSurfaceCreated(AMapDelegateImp.java:4320)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1548)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]  at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1286)

08-18 16:03:41.832 9298-9417/com.lanqian.skxcpt A/art: art/runtime/check_jni.cc:70]

08-18 16:03:41.833 9298-9417/com.lanqian.skxcpt A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 9417 (GLThread 584)

2016-09-08 :笔者今天在开发另外的安卓程序中使用高德地图api再一次遇到这个问题,不过今天有一个意外的发现:"Your app does not have the latest code changes because it was restarted manually. Please run from IDE instead",如下图,是再次运行出问题时的系统弹出框提示

这次用这段话google了一下下,然后找到一个相关的链接啦:http://stackoverflow.com/questions/36872586/android-studio-your-app-does-not-have-the-latest-code-changes ,也许是这个原因,也许不是,先更新记录下啦先。

根据stackoverflow中的讨论:得出的是android studio 的 instance run 的时候,app被手动重启,导致instance run 部署代码异常,估计跟着高德地图的jni代码部署也异常了。

解决方案:根据stackoverflow中的,Run>Clean and Re-Run ,这跟我问题描述中的解决方案一样。




最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • ¥开启¥ 【iAPP实现进入界面执行逐一显】 〖2017-08-25 15:22:14〗 《//首先开一个线程,因...
    小菜c阅读 7,219评论 0 17
  • 问题现象 复现步骤x86架构手机(Android 7.0)kernel 4.4小版本升级后,x86架构手机无法正常...
    dumphex阅读 2,369评论 0 1
  • 我长在高楼之上 我摇曳在百米之巅 悄然绽放 独享媚阳 于是,探出头去 想让世人,看到 我娇艳的脸庞 不想出轨 却还...
    六月孺子牛阅读 601评论 4 6
  • 我的代码结构如下面代码所示,无法执行,在img中的src属性中无法用mustache表示法 后来我将html中的代...
    牧码人小鹏阅读 3,137评论 0 0
  • 端午节到了, 墙角艾草疯狂生长, 采几片叶子制成艾条, 闪耀中华医学的光芒。 菖蒲池塘中, 如剑一般直射天堂, 挖...
    金赛月阅读 303评论 0 5

友情链接更多精彩内容