Wednesday, May 1, 2013

[android help] NoClassDefFoundError after refactoring name


I am using the Eclipse IDE to create an Android application compliant with Android 2.2 and higher. I refactored the name of one of my main activities. My basic structure is that I have a pseudo home page activity in which other "apps" (actually activities) inside this one app have icons that lead to their respective activity. I had a class that was originally the head activity for one of these branches in the app, call it Activity.java. Activity.java ended up just pointing to Activity_Home.java and no longer did anything so I decided to get rid of it. I deleted Activity.java, rebuilt, then refactored Activity_Home.java to Activity.java, rebuilt. Got a NoClassDefFoundError:



05-01 10:13:12.609: E/AndroidRuntime(15635): FATAL EXCEPTION: main
05-01 10:13:12.609: E/AndroidRuntime(15635): java.lang.NoClassDefFoundError: Activity.java


so then I renamed it back to Activity_Home.java after fiddling for a bit thinking that might help something. Completely cleaning and rebuilding before every attempt to launch. Kept getting the error even though I checked the CLASSPATH and that the .class file was being named correctly. Eventually I read that someone, though they don't know why this worked, fixed a similar problem by deleting and remaking the file. I did that.


That seems to have worked, but I don't know why and now every file deeper then Activity_Home.java (eg. there is an activity called by it Activity_Camera.java) is having the same issue.


I obviously do not want to have to delete and remake all of the .java files and even if that fixes the issue I would still like to know WHY this is happening not just HOW TO FIX it.



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...