Android Activity ClassNotFoundException - tried everything
I spent some time play with my own project, and I am able to replicate your problem and get exactly the same exception stack trace when trying to run my main project, so I think this could be the cause:
Just like what I thought, it is all about how you reference your Android library project in the Android main project, a simple Eclipse configuration settings.
The Wrong Way:
Right click main project, choose Properties -> Java Build Path -> Projects -> Add...
, this add the Android library Project as a dependency project in Android main project's build path, this does not work. If all required Android-related resources are defined in main project, you will not get any error at compile time, but when run the application, you get the exception described in the question.
The Correct Way:
Right click main project, choose Properties -> Android
, in the Library section, add your Android library project here. Check out official dev guide Referencing a library project. This should fix all your problem. Also note that you have to use relative path reference the actual Android library project, as stated in the Library Project - Development considerations.
Hope this helps.
Java.lang.ClassNotFoundException after Android studio update
Try this:
Clear app cache
Clear app data
Uninstall
app
Run/Debug
again
Hope it works!
Android Activity: ClassNotFoundException
You are setting the application node to reference a nonexistent class
de.bastian.gpstracker
Refers to the package name, no class whatsoever. Since gpstracker
is the last thing in that string, the class loader assumes that gpstracker
is a class, tries to load it and fails.
So write the name of the Application class (which extends Application
).
Eg
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name="de.bastian.gpstracker.MyApplicationClass" >
If you don't have a class that extends Application
, then take out the android:name
attribute for this node so it looks just like:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
ClassNotFoundException: if Android App downloaded from play store
I was including appcombat v7 in wrong way. A correct way is given here.
Related Topics
How to Style the Progressbar Component in Javafx
Firebase Android Listview Not Being Displayed
Virtual Memory Usage from Java Under Linux, Too Much Memory Used
The Use of Multiple Jframes: Good or Bad Practice
Why Do I Need to Override the Equals and Hashcode Methods in Java
Why Is Java Vector (And Stack) Class Considered Obsolete or Deprecated
Cannot Refer to a Non-Final Variable Inside an Inner Class Defined in a Different Method
How to Pad an Integer With Zeros on the Left
How Do Getters and Setters Work
Find Div Element by Multiple Class Names
Read/Write String From/To a File in Android
Decompiling Dex into Java Sourcecode
Running Jmap Getting Unable to Open Socket File
How to Write a Correct Micro-Benchmark in Java
Gui Not Working After Rewriting to MVC