Reputation: 3780
I use Eclipse for android development and trying to use IntelliJ. I have successfully run the application once. But now, I couldn't seem to rebuild the example Hello World application. What am I missing here? The R.java is not rebuilding anymore. Here is a screenshot of the errors.
And here is my setting
Upvotes: 7
Views: 9151
Reputation:
you can try to delete the r and buildconfig files from the com/x/x folder under android -> java
that fixed it for me.
Upvotes: 0
Reputation: 13540
This happened to me because I've marked source folders incorrectly. Under project settings once you click on particular module, Just check whether you have Mark any additional folders as source folders. Check the screenshot, By default it should be something like below, All mark as buttons should be unchecked
By mistake I've checked Mark as: "Source" button and I got this error. Just uncheck it.
Upvotes: 25
Reputation: 5881
Unfortunately you may not like my answer, but my project is due yesterday and I don't have time to check every setting to fix the issue.
The way I resolved it is to re-create a new project, only copying the src, res, lib etc across. This was painfully difficult and presents other issues (manifest files and run/debug configs) , but proved relatively short as opposed to creating a new project ANYWAY and sifting through build options that may or may not be valid.
I encountered the problem while trying to add the KSOAP2 libs to the IDEA project, and although KSOAP has nothing to do with the problem, I may have imported them in the incorrect manner the first time and created extra self referential dependancies. This makes the most sense, but trying to figure out how to undo it would be next to impossible.
Upvotes: 0
Reputation: 2260
R and BuildConfig are autogenerated by the android build system. Maybe you somehow copied an autogenerated version of your eclipse project into the idea project and then idea generated second ones. By default, idea will use a folder called gen for these files which is marked as a source folder. Make sure there are no other source folder containings these files.
You can quickly find classes by pressing Ctrl+N and starting to type the name of the class. If you find duplicate results, delete any of them and let idea regenerate the correct ones.
Upvotes: 2