gen 已存在但不是源文件夹

gen already exists but is not a source folder(gen 已存在但不是源文件夹)
本文介绍了gen 已存在但不是源文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发我的 Android 项目,删除未使用的库后,我收到 错误:

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

在我的 Activity 代码中,来自 R.java 的所有资源都无法解析.

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

我试过了,右键单击我的项目 => Java Build Path => 在源"选项卡下,我添加了 gen/作为源.但这对解决问题没有帮助...

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?

----更新----

我发现,eclipse还报错项目没有project.properties文件!编辑项目属性设置一个.",但我的项目下确实有 project.properties 文件.为什么会抱怨?我已经清理了项目并修复项目属性",但没有帮助.

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.

推荐答案

我遇到了同样的问题.

两个动作,第一个:

    1.右键单击项目并转到属性"
    1.Right click on the project and go to "Properties"

    2.选择左侧的Java Build Path"
    2.Select "Java Build Path" on the left

    3.打开来源"选项卡

    4.单击添加文件夹..."并检查gen"和src"
    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.右键单击项目并转到属性"
    1. Right click on the project and go to "Properties"

    2.选择左侧的Java Build Path"
    2. Select "Java Build Path" on the left

    3.打开库选项卡"

    4. 添加一个外部 JAR.添加您的 android 目录中的 Google API (android-sdkplatformsandroid-yourversion
    4. Add an external JAR. Add the Google API that is in your android directory (android-sdkplatformsandroid-yourversion

现在它对我有用!

这篇关于gen 已存在但不是源文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)