Workaround for the androidruntime:classnotfoundexception for Activity class occurs when Android application starts

Source: Internet
Author: User

The following exception was thrown when the android application was started to cause a startup failure:
07-09 17:12:35.709:error/androidruntime (3866): uncaught handler:thread main exiting due to uncaught exception

07-09 17:12:35.719:error/androidruntime (3866): java.lang.RuntimeException:Unable to instantiate activity Componentinfo{org.anselm.eickhoff.rhythm/org.anselm.eickhoff.rhythm.rhythmgameactivity}: java.lang.ClassNotFoundException:org.anselm.eickhoff.rhythm.RhythmGameActivity in loader [email protected]

07-09 17:12:35.719:error/androidruntime (3866): at Android.app.ActivityThread.performLaunchActivity ( activitythread.java:2497)

07-09 17:12:35.719:error/androidruntime (3866): at Android.app.ActivityThread.handleLaunchActivity ( activitythread.java:2621)

07-09 17:12:35.719:error/androidruntime (3866): at android.app.activitythread.access$2200 (ActivityThread.java:126)

07-09 17:12:35.719:error/androidruntime (3866): at Android.app.activitythread$h.handlemessage (ActivityThread.java : 1932)

07-09 17:12:35.719:error/androidruntime (3866): at Android.os.Handler.dispatchMessage (handler.java:99)

07-09 17:12:35.719:error/androidruntime (3866): at Android.os.Looper.loop (looper.java:123)

07-09 17:12:35.719:error/androidruntime (3866): at Android.app.ActivityThread.main (activitythread.java:4595)

07-09 17:12:35.719:error/androidruntime (3866): at Java.lang.reflect.Method.invokeNative (Native Method)

07-09 17:12:35.719:error/androidruntime (3866): at Java.lang.reflect.Method.invoke (method.java:521)

07-09 17:12:35.719:error/androidruntime (3866): at Com.android.internal.os.zygoteinit$methodandargscaller.run ( zygoteinit.java:860)

07-09 17:12:35.719:error/androidruntime (3866): at Com.android.internal.os.ZygoteInit.main (zygoteinit.java:618)

07-09 17:12:35.719:error/androidruntime (3866): at Dalvik.system.NativeStart.main (Native Method)

07-09 17:12:35.719: error/androidruntime (3866): caused by:java.lang.ClassNotFoundException: org.anselm.eickhoff.rhythm.RhythmGameActivity in loader [email protected]

07-09 17:12:35.719:error/androidruntime (3866): at Dalvik.system.PathClassLoader.findClass (Pathclassloader.java : 243)

07-09 17:12:35.719:error/androidruntime (3866): at Java.lang.ClassLoader.loadClass (classloader.java:573)

07-09 17:12:35.719:error/androidruntime (3866): at Java.lang.ClassLoader.loadClass (classloader.java:532)

07-09 17:12:35.719:error/androidruntime (3866): at Android.app.Instrumentation.newActivity (Instrumentation.java : 1021)

07-09 17:12:35.719:error/androidruntime (3866): at Android.app.ActivityThread.performLaunchActivity ( activitythread.java:2489)

07-09 17:12:35.719:error/androidruntime (3866): ... One more


Individuals are sorted in the following order:

1.

See if the name of the activity is written correctly in Manifest.xml.

2.

In manifest.xml confirm the format of the Android:name attribute in the Activity tab, for example, the name of my activity is HelloWorld, confirm Android:name= ". HelloWorld" (where the points are important).

3.

If you have an external package added, build the Libs directory in the project root directory, and then add the external package that you want to import into this directory, and then adding jars.

4.

If the problem persists if all of the above are OK, clean works off eclipse-> restart ADB on the command line (ADB kill-server adbstart-server), open eclipse-> Compile to start.

The above 4 steps will basically solve the problem.

Workaround for the androidruntime:classnotfoundexception for Activity class occurs when the Android application starts

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.