NoClassDefFoundError - Rejecting re-init on previously-failed class

前端 未结 5 2083
别跟我提以往
别跟我提以往 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: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.

提交回复
热议问题