02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: the return type of CallStaticIntMethodV does not match void com.zhongshu.gamebase.GameBase.PayForFee(int,int,java.lang.String,boolean,int) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] in call to CallStaticIntMethodV 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] from void org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesBegin(int,float,float) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] "GLThread 78367" prio=5 tid=4 Runnable 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] | group="main" sCount=0 dsCount=0 obj=0x12c05a60 self=0xafbc7c00 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] | sysTid=10645 nice=-11 cgrp=apps sched=0/0 handle=0xafb34580 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] | state=R schedstat=( 5629692946 1467228012 9735 ) utm=500 stm=62 core=3 HZ=100 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] | stack=0xb38fe000-0xb3900000 stackSize=1036KB 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] | held mutexes= "mutator lock"(shared held) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #00 pc 00004640 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int,ucontext*)+23) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #01 pc 00002e8d /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int,ucontext*)+8) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #02 pc 002453a1 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char,std::__1::char_traits<char> >&,char const*,art::mirror::ArtMethod*)+68) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #03 pc 00229f27 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char,std::__1::char_traits<char> >&) const+146) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #04 pc 000b0c0b /system/lib/libart.so (art::JniAbort(char const*,char const*)+582) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #05 pc 000b1345 /system/lib/libart.so (art::JniAbortF(char const*,...)+60) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #06 pc 000b20f7 /system/lib/libart.so (art::ScopedCheck::CheckSig(_jmethodID*,bool) (.constprop.131)+266) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #07 pc 000ba7c1 /system/lib/libart.so (art::CheckJNI::CallStaticIntMethodV(_JNIEnv*,_jclass*,_jmethodID*,std::__va_list)+60) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #08 pc 002a4088 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (_JNIEnv::CallStaticIntMethod(_jclass*,...)+60) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #09 pc 002a49b8 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (JniSelfTools::sendPayCommand(int,bool,int)+296) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #10 pc 003c78c0 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (SureChargeLayer::onControlPressCallback(cocos2d::CCObject*,unsigned int)+440) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #11 pc 00682ca4 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (cocos2d::extension::CCInvocation::invoke(cocos2d::CCObject*)+192) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #12 pc 00675870 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (cocos2d::extension::CCControl::sendActionsForControlEvents(unsigned int)+216) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #13 pc 00679530 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (cocos2d::extension::CCControlButton::ccTouchBegan(cocos2d::CCTouch*,cocos2d::CCEvent*)+428) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #14 pc 00840940 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (cocos2d::CCTouchDispatcher::touches(cocos2d::CCSet*,cocos2d::CCEvent*,unsigned int)+604) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #15 pc 00841038 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (cocos2d::CCTouchDispatcher::touchesBegan(cocos2d::CCSet*,cocos2d::CCEvent*)+56) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #16 pc 007e6aa4 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (cocos2d::CCEGLViewProtocol::handleTouchesBegin(int,int*,float*,float*)+616) 02-06 16:08:00.856: A/art(10628): art/runtime/check_jni.cc:65] native: #17 pc 007ee774 /data/app/com.shengsheng.wakeng.mm-1/lib/arm/libgame.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesBegin+88) 02-06 16:08:00.866: A/art(10628): art/runtime/check_jni.cc:65] native: #18 pc 0020cf2f /data/dalvik-cache/arm/data@app@com.shengsheng.wakeng.mm-1@base.apk@classes.dex (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesBegin__IFF+102) 02-06 16:08:00.866: A/art(10628): art/runtime/check_jni.cc:65] at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesBegin(Native method) 02-06 16:08:00.866: A/art(10628): art/runtime/check_jni.cc:65] at org.cocos2dx.lib.Cocos2dxRenderer.handleActionDown(Cocos2dxRenderer.java:125) 02-06 16:08:00.866: A/art(10628): art/runtime/check_jni.cc:65] at org.cocos2dx.lib.Cocos2dxGLSurfaceView$6.run(Cocos2dxGLSurfaceView.java:221) 02-06 16:08:00.866: A/art(10628): art/runtime/check_jni.cc:65] at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1471) 02-06 16:08:00.866: A/art(10628): art/runtime/check_jni.cc:65] at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248) 02-06 16:08:00.866: A/art(10628): art/runtime/check_jni.cc:65]
碰上这么一个错误,之前这些代码都好好的,现在跑android 5.0的机子挂了。仔细看,就知道是JNI出错了,
void com.zhongshu.gamebase.GameBase.PayForFee(int,int),原JAVA函数,但调用的是<pre name="code" class="cpp">CallStaticIntMethod,想想都明白了,将之改为CallStaticVoidMethod就好。平时copy代码,是要付出代码的。