csdnwr
csdnwr
采纳率76.5%
2015-12-04 03:47 阅读 5.9k
已采纳

jni调用java方法报错!!!

5

12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] JNI DETECTED ERROR IN APPLICATION: calling static method java.lang.String com.library.utils.MD5Utils.md5(java.lang.String) with CallObjectMethod
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] in call to CallObjectMethod
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] from java.lang.String com.mb.library.nativeutils.DmCoding.getMD5(java.lang.String)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] "main" prio=5 tid=1 Runnable
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] | group="main" sCount=0 dsCount=0 obj=0x752bf000 self=0xf4827800
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] | sysTid=23825 nice=0 cgrp=default sched=0/0 handle=0xf74bbbec
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] | state=R schedstat=( 387939683 56711068 527 ) utm=33 stm=5 core=0 HZ=100
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] | stack=0xff7b0000-0xff7b2000 stackSize=8MB
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] | held mutexes= "mutator lock"(shared held)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at com.mb.library.nativeutils.DmCoding.getMD5(Native method)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at com.colorpick.activity.CorCppTestActivity.onClick(CorCppTestActivity.java:53)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at android.view.View.performClick(View.java:4908)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at android.view.View$PerformClick.run(View.java:20378)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at android.os.Handler.handleCallback(Handler.java:815)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at android.os.Handler.dispatchMessage(Handler.java:104)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at android.os.Looper.loop(Looper.java:194)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at android.app.ActivityThread.main(ActivityThread.java:5691)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at java.lang.reflect.Method.invoke!(Native method)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at java.lang.reflect.Method.invoke(Method.java:372)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70]
12-04 11:33:08.818: A/libc(23825): Fatal signal 6 (SIGABRT), code -6 in tid 23825 (com.colorpick)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    csdnwr csdnwr 2015-12-04 06:39

    这个是由于jni方法名称与javanative声明的不对应

    点赞 评论 复制链接分享
  • CSDNXIAOS Robot-S 2015-12-04 03:50

    JNI调用Java方法 JNI 调用java类的方法与反射代码类似。先得到object的类。-->jobject obj;jclass cls = env->GetObjectClass(obj);然后查找方法:jmethodID mgetZoom = env->GetMethodID(cls,"getZoom","()I");jmethodID g......
    答案就在这里:JNI调用Java方法
    ----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

    点赞 1 评论 复制链接分享

相关推荐