Mac启动Android Studio加载Project时报错:Unsupported Modules Detected

启动Android Studio后,Gradle开始Sync,Sync完成后,出现如下错误:

unsupported modules detected Compilation is not supported for following modules: app. Unfortunately you can’t have non-Gradle Java modules and Android-Gradle modules in one project

尝试过如下方法均失败:

1.Build-->Clean Project
2.File -> Invalidate Caches / Restart -> Invalidate Caches & Restart.
3.File -> Sync Project With Gradle Files

最终解决方案如下:

1.关闭Android Studio
2.打开终端,进入项目根目录,输入:cd 你的项目根目录,比如我的 cd WorkSpace/MyProject
3.打开.idea文件夹(一个隐藏文件夹):open .idea
4.把里面所有的文件放进废纸篓
5.重启Android Studio问题解决

推荐参考:https://stackoverflow.com/questions/28668252/android-studio-error-unsupported-modules-detected-compilation-is-not-supported

你可能感兴趣的:(Mac启动Android Studio加载Project时报错:Unsupported Modules Detected)