gen already exists but is not a source folder

前端 未结 15 1079
深忆病人
深忆病人 2020-12-22 23:37

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 fold         


        
相关标签:
15条回答
  • 2020-12-22 23:56

    We also need to check our import statements, If we have imported 'android.R' got to remove that.

    0 讨论(0)
  • 2020-12-22 23:58

    I tried the suggestions given here and still had the problem. Finally, it turned out that Eclipse got its imports wrong. For some reason it added the words "gen" and "src" to the beginning of the import line. I had to change all the import lines from

    import gen.org.qtproject.qt5.android.bindings.QtApplication;
    

    to

    import org.qtproject.qt5.android.bindings.QtApplication;
    

    Once I did that, everything came back to normal.

    0 讨论(0)
  • 2020-12-22 23:59

    i had to delete the entire gen folder within eclipse not from file explorer. then did a clean and it was rebuilt. funny this occured right after i ran a Lint HTML report.

    0 讨论(0)
  • 2020-12-23 00:01

    This happens because your .classpath file got wiped out somehow. This file contains all the information from the Java Build Path tab under Project Properties. You could add in all information manually but there's an easier way of fixing this problem.

    If you have a copy of the .classpath file on your machine, you can just copy and paste it into your project directory.

    0 讨论(0)
  • 2020-12-23 00:05

    This is caused by using the wrong importer in Eclipse. If you have Android projects, you need to import them into your workspace with Android->Existing Android Code, not General->Existing Projects.

    enter image description here

    0 讨论(0)
  • 2020-12-23 00:06

    Go to the project properties then Go to Java Build Path then Remove already exist folder then Click Add Folder then Add the Source and gen folder. then Press ok............It will work.......

    0 讨论(0)
提交回复
热议问题