Android Eclipse issue Failed to create BuildConfig class

好久不见. 提交于 2019-12-08 16:13:53

问题


I am getting "Failed to create BuildConfig class" error while cleaning android project in eclipse. I have recently installed Eclipse Juno for Mobile developers and while I was trying to import my existing android applications, Eclipse started giving me this kind of error.

Eclipse is working fine If I create new android projects. What could be the possible cause and probable solution for this issue?

I am using OS - Windows Server 2008


回答1:


I had the error after updating (installing) Juno and letting it migrate my workspace and local git repo. Before that error I got another error:

JavaBuilder handling ImageBuilderInternalException while building: <projectname>

Finally I found out that the error was caused by file perms and the problem resolved after resetting them:

chown <me>:<me> <my-repo>

The reason behind the broken permissions: during the process of installing the MOTODEV plugins to Eclipse JUNO I had to start my Eclipse with 'sudo'. Obviously that run overwrote some of my files during the automatic build.




回答2:


This has never happened to me. I tried to import an old workspace in a Juno Eclipse for Mobile and it was ok. I also tried to import only an old android project, and it had no errors. Which ADT version are you using?

I also found an issue related to 9-patch, maybe it was your case.




回答3:


I had this problem when opening a copy of project that had previously been under source control, and the

\gen\{com\foo\namespace}\BuildConfig.java file was read only.

Unchecking the read only flag on the BuildConfig.java did the trick for me.




回答4:


I had similar issue with Windows 10 and Eclipse. It occurred in the middle of session between two builds. I tried restarting Eclipse, tried in vain to change permissions but nothing helped.

I finally rebooted my laptop and problem was gone.



来源:https://stackoverflow.com/questions/11573810/android-eclipse-issue-failed-to-create-buildconfig-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!