NoClassDefFoundError - Rejecting re-init on previously-failed class

前端 未结 5 2048
别跟我提以往
别跟我提以往 2021-01-12 04:57

Please somebody explain me what this error means and how to avoid it.

After a while my app Force Closes because of this error:

09-28 12:53:45.746 I/d         


        
相关标签:
5条回答
  • 2021-01-12 05:31

    I started having this problem after building another project with New Relic analytics enabled. Gradle daemon then cached the New Relic agent and it couldn't launch the other app.

    What helped was

    ./gradlew --stop
    
    0 讨论(0)
  • 2021-01-12 05:31

    you must add uses-library in your AndroidManifest.xml

    0 讨论(0)
  • 2021-01-12 05:32

    This happens when a class couldn't be loaded for a variety of reasons. Unfortunately the new ART runtime doesn't log sufficient information as to the cause of this. If you can get hold of an older android device with Dalvik you'll see different logging, usually revealing the offence with more precision.

    Last time I saw it live I had to deal with a JAR file that didn't actually include or list its dependencies, so adding the right dependent library to the gradle file solved it. The biggest issue is to figure which classes went missing - something dalvik logs/decompilation/documentation might be able to tell you.

    There are many other reasons why classes can't be loaded in the entirety of the Java language so this specific cause might not apply universally.

    0 讨论(0)
  • 2021-01-12 05:34

    Happens for me only if instant run is enabled.

    0 讨论(0)
  • 2021-01-12 05:38

    Are you sure is this the first exception you are getting after running your application? There may be some uncaught exceptions previously.

    0 讨论(0)
提交回复
热议问题