Java.lang.NoSuchMethodError:no Static or Non-static method solution

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.