【问题标题】:Android studio Error "Unsupported Modules Detected: Compilation is not supported for following modules"Android Studio 错误“检测到不支持的模块:以下模块不支持编译”
【发布时间】:2015-04-24 10:48:13
【问题描述】:

我使用的是 Android Studio 1.0.1。我的项目中有一个由其他模块引用的 java 模块。我已经从 SVN 中检查过了,但现在每个

检测到不支持的模块:以下模块不支持编译:.不幸的是,您不能在一个项目中同时拥有非 Gradle Java 模块和 Android-Gradle 模块。

收到此错误后,请停止编译此模块,这样我就无法再编译/运行我的项目了。

【问题讨论】:

标签: android intellij-idea android-studio ide android-ide


【解决方案1】:

删除项目中的 *.iml 文件 和 使缓存失效并重新启动

【讨论】:

    【解决方案2】:

    以上所有答案都是正确的,但在我的情况下,我的应用程序目录中没有可用的 lib 文件夹,我试图在应用程序 gradle 文件中调用以下行

     compile fileTree(include: ['*.jar'], dir: 'libs')
    

    因此,请确保您在 gradle 文件中声明的任何依赖项都可用于应用程序

    【讨论】:

      【解决方案3】:

      我也有同样的问题。我试过Invalidate Cache / Restartsync project with Gradle Files 但仍然没有用。 但通过使用以下步骤工作:

      1. gradle.wrapper.properties 升级 gradle 分发版本。

        distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
        
      2. 还有 build.gradle 项目中的 Android Gradle 插件

         classpath 'com.android.tools.build:gradle:4.1.2' //upgrade gradle plugin here
        
      3. 然后Invalidate Cache / Restart

      4. 这一切都解决了我的问题。希望你也是

      【讨论】:

        【解决方案4】:

        在应用程序中检查 build.gradle 你有很好的编译链接。我对这一行有错误 compile 'com.android.support:support-annotations:x.x.x' 删除并工作。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2022-11-18
          • 2021-06-11
          • 2019-05-24
          • 2022-11-09
          • 1970-01-01
          • 2016-12-28
          • 2014-06-24
          • 1970-01-01
          相关资源
          最近更新 更多