Android 梯度限制’;s在创建新模块时新的变量感知依赖关系管理
我在一个项目中有多个模块。我尝试在项目中创建一个新模块(电话和平板电脑模块)。但当Gradle尝试同步时,我得到了错误: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
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类路径相同
- 删除模块渐变中的所有内容以使其同步李>
- 导入模块而不是创建新模块李>