gpt4 book ai didi

android - 无法解析 androidx.databinding :databinding-compiler:3. 5.3

转载 作者:行者123 更新时间:2023-12-05 00:20:18 30 4
gpt4 key购买 nike

我只是将我的项目转换为 androidX 并成功构建项目。但是当我想运行那个时间时,它在启用了 java 的 android studio 3.5.3 中创建了这个错误。

这是我的项目 gradle:

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
}
}

allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}

我的模块 gradle 文件:我在这里添加的所有依赖项。
     apply plugin: 'com.android.application'
android {
dataBinding {
enabled = true
}

compileSdkVersion 28
defaultConfig {
applicationId "com.exam.test"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
signingConfig signingConfigs.release
}

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

//Dependencies

dependencies {
api 'com.google.android.material:material:1.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.google.android.gms:play-services-location:16.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
transitive = true
}
implementation 'androidx.biometric:biometric:1.0.1'

}
apply plugin: 'com.google.gms.google-services'
googleServices.disableVersionCheck = true

构建输出:运行应用程序时,此处的 pom 详细信息未下载
 FAILURE: Build failed with an exception.  
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugAnnotationProcessorClasspath'.
> Could not resolve androidx.databinding:databinding-compiler:3.5.3.
Required by:
project :app
> Could not resolve androidx.databinding:databinding-compiler:3.5.3.
> Could not get resource 'https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-compiler/3.5.3/databinding-compiler-3.5.3.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-compiler/3.5.3/databinding-compiler-3.5.3.pom'.
> Remote host closed connection during handshake

* 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.

最佳答案

出现这些类型的问题是因为某些库彼此不协调
那么你应该更新也许你的问题会消失。
我有同样的问题,现在解决了。

首先升级你的gradle
distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip

第二次更新你的 kotlin-plugin
类路径“org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61”

第三次将您的 android studio 更新到最新版本 3.6 或更高版本
注意:这部分可能会显示错误,那么你应该更新你的约束布局
实现 'androidx.constraintlayout:constraintlayout:2.0.0-beta3'

我希望你解决它

关于android - 无法解析 androidx.databinding :databinding-compiler:3. 5.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60372789/

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