Android 1.5 在eclipse中出现 Internal Error 错误 解决防范
今天莫名其妙的Android项目 在eclipse下就报错了,报错类型为:
ErrorLog中显示:
Internal Error
Java Model Exception: Java Model Status [gen [in HelloAndroid] does not exist]
Problems中显示:
Description Resource Path Location Type
Project 'HelloAndroid' is missing required source folder: 'gen' HelloAndroid Build path Build Path Problem
clean projected也不行,还是报错,但是gen和R.java都是存在的,这个可能是adt的bug。
后来折腾了半天解决了 解决办法为:
1.在eclipse中删除gen文件夹 Delete the R.java file under the gen folder
2.刷新项目,此时一般情况选择了自动编译的会自动生成gen的 现在出问题了没有自动生成 Refresh the project
3.选择project-build project 编译项目就可以了 最好将project –auto building 勾选上。Build Project, not Clean
出现问题还可能采用的解决办法有
检查java compiler中使用的jdk 可以更换下试试 先跟换为1.5,编译一遍然后更换回1.6试试
检查Android Sdk 模拟器版本 重新设置试试看,
详细错误内容:
eclipse.buildId=I20090611-1540
java.version=1.6.0_07
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN
Framework arguments: -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product -data D:\ByreadSourse -product org.eclipse.epp.package.jee.product
Error
Sat Jun 26 13:21:23 CST 2010
Internal Error
Java Model Exception: Java Model Status [gen [in HelloAndroid] 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)