gpt4 book ai didi

android - 无法更改依赖配置的解析策略,更新到 'com.android.tools.build:gradle:4.1.0'后

转载 作者:行者123 更新时间:2023-12-03 09:40:52 31 4
gpt4 key购买 nike

我更新了com.android.tools.build:gradle到 4.1.0 版和 Android Studio 到 4.1 版,现在我收到此错误:

Cannot change resolution strategy of dependency configuration':app:devDebugRuntimeClasspath' after it has been resolved.


如果我将 gradle 降级到 4.0.2,它会运行...
可能是什么,没有更新的库(这将是一个重大变化,不认为这是原因,但是......)?
应用 模块:
plugins {
id("com.android.application")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
kotlin("android")
kotlin("android.extensions")
kotlin("kapt")
}

android {
...

flavorDimensions("app")

productFlavors {
create("prod") {
missingDimensionStrategy("module_network_dim", "urlProd")
}

create("qa") {
applicationIdSuffix = ".qa"
missingDimensionStrategy("module_network_dim", "urlQa")
}

create("dev") {
applicationIdSuffix = ".dev"
missingDimensionStrategy("module_network_dim", "urlDev")
}
}
}

dependencies {
implementation(project(":module-core"))
implementation(project(":module-network"))
implementation(project(":module-common"))

//a lot of individual libs dependencies...
}
网络模块:
    plugins {
id("com.android.library")
kotlin("android")
kotlin("android.extensions")
kotlin("kapt")
}

android {
compileSdkVersion(AndroidConstants.compileSdkVersion)
defaultConfig {
minSdkVersion(AndroidConstants.minSdkVersion)
}
androidExtensions {
isExperimental = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

flavorDimensions("module_network_dim")

productFlavors {
create("urlProd") {
buildConfigField("String", "IS_URL", ...)
buildConfigField("String", "API_URL", ...)
buildConfigField("String", "CLIENT_ID", ...)
}

create("urlQa") {
buildConfigField("String", "IS_URL", ...)
buildConfigField("String", "API_URL", ...)
buildConfigField("String", "CLIENT_ID", ...)
}

create("urlDev") {
buildConfigField("String", "IS_URL", ...)
buildConfigField("String", "API_URL", ...)
buildConfigField("String", "CLIENT_ID", ...)
}
}
}

dependencies {
//individual libs dependencies...
}
核心 / 常见 模块:
plugins {
id("com.android.library")
kotlin("android")
kotlin("android.extensions")
kotlin("kapt")
}

android {
compileSdkVersion(AndroidConstants.compileSdkVersion)

defaultConfig {
minSdkVersion(AndroidConstants.minSdkVersion)
android.buildFeatures.dataBinding = true
}

androidExtensions {
isExperimental = true
}

kotlinOptions {
jvmTarget = "1.8"
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

testOptions {
unitTests.apply {
isReturnDefaultValues = true
isIncludeAndroidResources = true
}
}
}

dependencies {
//individual libs dependencies...
}
An issue was open .

最佳答案

com.android.tools.build:gradle:4.1.1似乎解决了“问题”

关于android - 无法更改依赖配置的解析策略,更新到 'com.android.tools.build:gradle:4.1.0'后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64354852/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com