Android 梯度限制’;s在创建新模块时新的变量感知依赖关系管理

Android 梯度限制’;s在创建新模块时新的变量感知依赖关系管理,android,android-studio,gradle,android-gradle-plugin,gradle-plugin,Android,Android Studio,Gradle,Android Gradle Plugin,Gradle Plugin,我在一个项目中有多个模块。我尝试在项目中创建一个新模块(电话和平板电脑模块)。但当Gradle尝试同步时,我得到了错误: Error:(1, 0) Due to a limitation of Gradle’s new variant-aware dependency management, loading the Android Gradle plugin in different class loaders leads to a build error. This can occur whe

我在一个项目中有多个模块。我尝试在项目中创建一个新模块(电话和平板电脑模块)。但当Gradle尝试同步时,我得到了错误:

Error:(1, 0) Due to a limitation of Gradle’s new variant-aware dependency management, loading the Android Gradle plugin in different class loaders leads to a build error.
This can occur when the buildscript classpaths that contain the Android Gradle plugin in sub-projects, or included projects in the case of composite builds, are set differently.
To resolve this issue, add the Android Gradle plugin to only the buildscript classpath of the top-level build.gradle file.
In the case of composite builds, also make sure the build script classpaths that contain the Android Gradle plugin are identical across the main and included projects.
If you are using a version of Gradle that has fixed the issue, you can disable this check by setting android.enableBuildScriptClasspathCheck=false in the gradle.properties file.
To learn more about this issue, go to https://d.android.com/r/tools/buildscript-classpath-check.html.
我尝试过的一些方法是:

  • 使模块之间的buildscript类路径相同
  • 删除模块渐变中的所有内容以使其同步
  • 导入模块而不是创建新模块
+1谢谢你的提问,我在gradle的世界里并不是一个真正的职业选手。但我想知道如何解决这类问题,因为我也在创建android应用程序。所以,如果可能的话,我想帮助解决这个问题。至于我的第一个可能的解决方案,这个()解决了你的问题吗