android :app:数据绑定合并依赖项对象调试“错误

svujldwt  于 2022-12-21  发布在  Android
关注(0)|答案(3)|浏览(252)

**问题的原因是什么?**我在应用程序销售中遇到了这样的错误。我找不到任何解决方案。

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
   > Could not resolve androidx.core:core-ktx:+.
     Required by:
         project :app
      > Skipped due to earlier error
      > Failed to list versions for androidx.core:core-ktx.
         > Unable to load Maven meta-data from https://dl.bintray.com/kotlin/kotlin-eap/androidx/core/core-ktx/maven-metadata.xml.
            > Could not get resource 'https://dl.bintray.com/kotlin/kotlin-eap/androidx/core/core-ktx/maven-metadata.xml'.
               > Could not GET 'https://dl.bintray.com/kotlin/kotlin-eap/androidx/core/core-ktx/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
kuarbcqp

kuarbcqp1#

您需要正确声明依赖项"androidx.core:core-ktx:$core_version"

watbbzwu

watbbzwu2#

这是因为现在不再支持文件盒了。转到你的项目级别build.gradle,注解掉allprojectsrepositories部分中的文件盒依赖项
Bintray Shutdown

jaql4c8m

jaql4c8m3#

正如@Narendra_Nath所说,这是由于bintray依赖项和Jcenter关闭。您可以参考本文https://blog.gradle.org/jcenter-shutdown
对我有效的解决方案是将(Top-level build.gradle)中的存储库更改为

buildscript {
      repositories {
        google()
        mavenCentral()
        maven {
        url "https://repo.spring.io/release"
        }
        maven {
        url "https://repository.jboss.org/maven2"
      } }

相关问题