Android caused by: java.lang.classnotfoundexception solution

Android caused by: java.lang.classnotfoundexception solution

Problem:

08-13 18:29:22.924: E/AndroidRuntime(1875): Caused by: Java.lang.ClassNotFoundException:XXXXX in loader dalvik.system.PathClassLoader[/data/app/XXXX.apk]

I think we often have an exception of classnotfoundexception because of negligence. This exception in Android development simply tells you that the class is not found, so what is the reason why it is not found?

In fact, there are generally two situations:

1. When you start an activity, you may forget to add an activity at all in androidmanifest.xml, or the package name or name of the activity is misspelled, which has a high probability of making mistakes

2. The class you use is an external jar package. When it is compiled and used in the project, it is published as APK and does not contain jar files. Therefore, APK cannot find jar files during execution and will report an error.

So be sure to check the jar package used in "order and export". Remember!

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>