Java Model Exception: Java Model Status [gen [in MyApp] does not exist] after Eclipse Android project Clean
Asked Answered
S

7

6

After performing a Menubar> Project> Clean... I get the following error in the errorlog:

Java Model Exception: Java Model Status [gen [in MyApp] does not exist] at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:502) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238) at org.eclipse.jdt.internal.core.PackageFragmentRoot.getKind(PackageFragmentRoot.java:477) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:645) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:791) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:734) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:791) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:734) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.elementChanged(PackageExplorerContentProvider.java:124) at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1557) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1547) at org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1381) at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1357) at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1958) at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470) at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149) at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:313) at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1022) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Any ideas if this is a problem and what is causing it? It occurs whether I Clean just my project or all projects

  • Frink

My Development Environment is: Eclipse 3.5.2 with ADT 0.9.7 (2.1) and Java SDK 6 Update 21 32bit Windows XP VirtualBox VM on 64bit Windows 7 AMD Phenom II X4 955 Processor @3.20GHz with 4GB RAM

Sheng answered 9/8, 2010 at 9:20 Comment(1)
Hello FrinkTheBrave, thanks for marking my answer as the accepted one, could you also please upvote it? Thanks.Nitro
N
3

Had a similar error for different reasons. My error started after renaming the target package in the project. After I tried the solution from paskster without success, I started diggin'.

The actual problem was that renaming the package name from the manifest file didn't work as expected. I thought it would change everything everywhere. However, the old package name was still in the manifest file in the test directory, and in some views in the resources. After renaming those manually and rebuilding the project, the error was gone.

Nitro answered 16/11, 2010 at 21:59 Comment(1)
+1 for you! I can't believe it. My long-standing problem (#3359669) has now been solved - it was a simple naming problem!Angara
K
2

Try this, worked for me:

  • Delete the R.java file under the gen folder
  • Refresh the project
  • Build Project

Found here: http://www.joshuakerr.com/2009/10/23/android-and-the-missing-gen-folder/

Kravits answered 19/11, 2010 at 15:21 Comment(0)
T
1

I had the exact same problem.

Closing the AndroidProject, Restarting Eclipse and Reopening the AndroidProject solved the problem for me! Not at the first time, but after second or third time doing this, the error just disappered!

Weired thing is that by searching at google you pretty much only get this thread. So seems like it is a very new problem, maybe some update of the SDK that caused it.

Thinner answered 10/8, 2010 at 12:13 Comment(3)
Cheers for that. I've only just started Android development and there do seem to be one or two little glitches in the SDK. Would't know whether they are due to Eclipse or Android thoSheng
When I solved your problem, I would be happy to receive an upvote and your acception of the answer :)Thinner
I appreciate your answer paskster, but I have tried your solution and it didn't work for me, so I've given you an upvote, but no accept, I'm afraid. Glad you solved your problem tho :-)Sheng
C
1

You can check the Problems Tab in Eclipse.The Error was due to Java Build Path not configured. You can set the environment variable in MyComputer settings as C:\Program Files\Java\jre6\bin and restart the eclipse. I hope it'll work for you as it worked for me :)

Caitlin answered 17/1, 2011 at 15:1 Comment(0)
C
0

This worked for me.

Try right mouse clicking on Project (in Package Explorer)

Android Tools > Fix Project Properties

Project > Clean......

Coniine answered 18/11, 2010 at 1:53 Comment(0)
B
0

I was facing a similar problem and resolve it by manually building the projects that were causing the issue and then running clean all/build.

Bewick answered 23/3, 2012 at 13:49 Comment(0)
G
0

I have faced the same issue . I have tried all the solutions given ,but none of the solution is worked for me. Later I realized that I have changed my aapt.exe(provided with android sdk) with another aapt.exe .So, when I revert back the changes ,Issue is resolved automatically.Actually I was changing aapt.exe to aapt_real.exe and putting some other aapt.exe which is required for some specific project.So , be insure that your aapt.exe should be the same as given along with android sdk ie ADT. Also take care that the workspace name created in eclipse should not contain spaces. For eg workspace name should not be like that "new workspace". If space is there in eclipse workspace's name then it also causes the same error.So, In order to remove this error you have to create new workspace in eclipse without any space.

Gluconeogenesis answered 17/1, 2014 at 9:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.