Caused by: Java. Lang. classnotfoundexception [Android ultimate solution Error]

Source: Internet
Author: User

Caused by: Java. Lang. classnotfoundexception: XXXXX In loader Dalvik. system. pathclassloader [/data/APP/xxxx.apk]

I think we often encounter classnotfoundexception exceptions due to negligence. In Android development, this exception is nothing more than telling you that the class is not found. Why did it fail to be found?

In fact, there are two situations:

1. When you start an activity, you may forget to add an activity in androidmanifest. XML, or the package name or name of the activity is wrong. This error is highly likely.

2. Your class is an external jar package. When it is compiled and used in the project, it is published as an APK and does not contain the JAR file, therefore, when the APK is executed, the JAR file cannot be found, and an error is returned.

Therefore, you must check the jar package in "order and export. Remember!

If none of the above two items exist, you can check the following

Change

After changing the location, it will be OK.

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.