Gradle中的依赖更新导致了一系列困难的错误。

huangapple go评论67阅读模式
英文:

Dependency update in Gradle results in a number of challenging errors

问题

在 Build.gradle(Module:app) 中,我更新了以下内容,

dependencies {
  implementation 'androidx.appcompat:appcompat:1.6.1'
  implementation 'com.google.android.material:material:1.9.0'
  implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
  implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
  testImplementation 'junit:junit:4.13.2'
  androidTestImplementation 'androidx.test.ext:junit:1.1.5'
  androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

并开始出现以下错误报告,

Gradle中的依赖更新导致了一系列困难的错误。

有关在哪里查找问题的建议吗?我已尝试交换单个依赖项以缩小问题范围,但更新前五个中的任何一个都会导致错误。刚刚更新到 Gradle 8.0.2。提前感谢。

英文:

In Build.gradle(Module :app), I updated the following,

dependencies {
  implementation 'androidx.appcompat:appcompat:1.2.0'
  implementation 'com.google.android.material:material:1.3.0'
  implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.0'
  implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0'
  testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

to this,

dependencies {
  implementation 'androidx.appcompat:appcompat:1.6.1'
  implementation 'com.google.android.material:material:1.9.0'
  implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
  implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
  testImplementation 'junit:junit:4.13.2'
  androidTestImplementation 'androidx.test.ext:junit:1.1.5'
  androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

and began getting the following errors reported,

Gradle中的依赖更新导致了一系列困难的错误。

Any suggestions as to where to look for the problem? I have tried swapping individual dependencies to narrow the problem down, but updating any of the first five will cause the error. Just updated to Gradle 8.0.2. Thanks in advance.

答案1

得分: 0

这个已经成功运行。

dependencies {

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
//implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
//implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
英文:

This worked.

dependencies {

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
//implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
//implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

huangapple
  • 本文由 发表于 2023年6月5日 10:57:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76403268.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定