英文:
Android Studio - Unsupported Modules Detected - Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project
问题
我今天在我的Android Java项目中将gradle从版本3.5.3
升级到了3.6.2
,现在我遇到了这个错误:
检测到不受支持的模块
以下模块不支持编译:NameOfMyApp,app。很遗憾,您不能在一个项目中同时拥有非Gradle Java模块和Android Gradle模块。
不幸的是,我尝试了链接问题中的每个解决方案,但没有任何效果。我仍然遇到这个错误。虽然我的项目似乎可以正常编译和工作,但这个错误令人讨厌... 不断弹出。
有人知道如何修复吗?自从升级了Android Studio、gradle和其他最近推出的更新以来,我才开始遇到这个问题。
英文:
I upgraded gradle from version 3.5.3
to 3.6.2
today in my Android Java project, and now I get this error:
Unsupported Modules Detected
Compilation is not supported for following modules: NameOfMyApp, app. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
Unfortunately, I tried every solution in the linked question, but nothing worked. I still get this error. It seems like my project compiles and works just fine though. However, this error is annoying... continually popping up.
Anyone know how to fix it? I only started having this issue since the upgrade of Android Studio, gradle, and other updates recently pushed out.
答案1
得分: 17
按照以下步骤逐一解决错误:
- 关闭项目
- 退出 Android Studio
- 然后转到您的应用程序文件夹并删除 .iml 文件
- 同样删除 .idea 文件夹
- 然后重新打开 Android Studio 并导入您的项目
注意:如果 .iml 和 .idea 文件不可见,那么当您在应用程序文件夹内时,同时按下 Command、shift 和 > 按钮
英文:
Follow these steps one by one to solve the error.
- Close the Project
- Exit Android Studio
- Then go to your application folder and delete .iml file
- And also delete .idea Folder
- Then open Android studio again and import your project
Note- If .iml and .idea files are not visible then press Command, shift and > buttons together when you are inside your Application folder
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论