Recently, when debugging JNI, I reported an inexplicable error, the same type of function can be registered successfully, the different types will throw an exception:
E AndroidRuntime:java.lang.NoSuchMethodError:no Static or Non-static method "Lcom/sprd/validationtools/phasecheckjni /phasecheckjni;. Eng_writephasecheck (III) I "
E Androidruntime:At Java.lang.Runtime.nativeLoad (Native Method)
E Androidruntime:At Java.lang.Runtime.doLoad (runtime.java:421)
E Androidruntime:At Java.lang.Runtime.loadLibrary (runtime.java:362)
E Androidruntime:At Java.lang.System.loadLibrary (system.java:526)
E Androidruntime:At Com.sprd.validationtools.phasecheckjni.phasecheckjni.<clinit> (phasecheckjni.java:6)
E Androidruntime:At Com.sprd.validationtools.phasecheckparse.<init> (phasecheckparse.java:66)
E Androidruntime:At Com.sprd.validationtools.ValidationToolsMainActivity.onCreate (validationtoolsmainactivity.java:126)
E Androidruntime:At Android.app.Activity.performCreate (activity.java:5258)
E Androidruntime:At Android.app.Instrumentation.callActivityOnCreate (instrumentation.java:1099)
E Androidruntime:At Android.app.ActivityThread.performLaunchActivity (activitythread.java:2239)
E Androidruntime:At Android.app.ActivityThread.handleLaunchActivity (activitythread.java:2349)
E Androidruntime:At android.app.activitythread.access$800 (activitythread.java:151)
E Androidruntime:At Android.app.activitythread$h.handlemessage (activitythread.java:1243)
E Androidruntime:At Android.os.Handler.dispatchMessage (handler.java:102)
E Androidruntime:At Android.os.Looper.loop (looper.java:136)
E Androidruntime:At Android.app.ActivityThread.main (activitythread.java:5372)
E Androidruntime:At Java.lang.reflect.Method.invokeNative (Native Method)
E Androidruntime:At Java.lang.reflect.Method.invoke (method.java:515)
E Androidruntime:At Com.android.internal.os.zygoteinit$methodandargscaller.run (zygoteinit.java:970)
E Androidruntime:At Com.android.internal.os.ZygoteInit.main (zygoteinit.java:786)
E Androidruntime:At Dalvik.system.NativeStart.main (Native Method)
This is due to compiler optimizations that require the following attributes to be added to the ANDROID.MK:
local_proguard_enabled:= disabled
Java.lang.NoSuchMethodError:no Static or Non-static method solution