Android Studio – Unsupported Modules Detected – Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project

huangapple go评论73阅读模式
英文:

Android Studio - Unsupported Modules Detected - Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project

问题

关于 https://stackoverflow.com/questions/30142056/error-unfortunately-you-cant-have-non-gradle-java-modules-and-android-gradle

我今天在我的Android Java项目中将gradle从版本3.5.3升级到了3.6.2,现在我遇到了这个错误:

检测到不受支持的模块

以下模块不支持编译:NameOfMyApp,app。很遗憾,您不能在一个项目中同时拥有非Gradle Java模块和Android Gradle模块。

不幸的是,我尝试了链接问题中的每个解决方案,但没有任何效果。我仍然遇到这个错误。虽然我的项目似乎可以正常编译和工作,但这个错误令人讨厌... 不断弹出。

有人知道如何修复吗?自从升级了Android Studio、gradle和其他最近推出的更新以来,我才开始遇到这个问题。

英文:

Related to https://stackoverflow.com/questions/30142056/error-unfortunately-you-cant-have-non-gradle-java-modules-and-android-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

按照以下步骤逐一解决错误:

  1. 关闭项目
  2. 退出 Android Studio
  3. 然后转到您的应用程序文件夹并删除 .iml 文件
  4. 同样删除 .idea 文件夹
  5. 然后重新打开 Android Studio 并导入您的项目

注意:如果 .iml 和 .idea 文件不可见,那么当您在应用程序文件夹内时,同时按下 Commandshift> 按钮

英文:

Follow these steps one by one to solve the error.

  1. Close the Project
  2. Exit Android Studio
  3. Then go to your application folder and delete .iml file
  4. And also delete .idea Folder
  5. 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

huangapple
  • 本文由 发表于 2020年4月7日 12:12:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/61072724.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定