Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gen already exists but is not a source folder

I am developing my Android project, After I removed a unused library, I got the error:

myproject/gen already exists but is not a source folder. Convert to a source folder or rename it 

In my Activity code, all resources from R.java can not be resolved.

I tried, right click on my project => Java Build Path => under "Source" tab, I added gen/ as source. But it does not help with the problem...

Why, how to get rid of this problem?

----UPDATE----

I found that, the eclipse also complain that "Project has no project.properties file! Edit the project properties to set one." , but I do have project.properties file under my project. Why it complains? I have cleaned the project and "fix project properties" but it does not help.

like image 726
Leem.fin Avatar asked Mar 02 '12 10:03

Leem.fin


1 Answers

I get the same problem.

Two actions, first:

    1.Right click on the project and go to "Properties"
    2.Select "Java Build Path" on the left
    3.Open "Source" tab
    4.Click "Add Folder..." and check "gen" and "src"

second: (because the previous action asked me to remove something... I do not remember what it was...)

    1. Right click on the project and go to "Properties"
    2. Select "Java Build Path" on the left
    3. Open Libraries "tab"
    4. Add an external JAR. Add the Google API that is in your android directory (android-sdk\platforms\android-yourversion

And now it works for me!

like image 62
AntoineP Avatar answered Sep 30 '22 01:09

AntoineP