无法解析androidx。数据绑定:数据绑定编译器:3.5.3
我只是将我的项目转换为androidX并成功构建了项目。但当我想运行时,它在启用java的android studio 3.5.3中创建了这个错误 这是我的项目gradle:无法解析androidx。数据绑定:数据绑定编译器:3.5.3,android,data-binding,androidx,Android,Data Binding,Androidx,我只是将我的项目转换为androidX并成功构建了项目。但当我想运行时,它在启用java的android studio 3.5.3中创建了这个错误 这是我的项目gradle: buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.3' clas
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" }
}
}
我的模块渐变文件:我在这里添加的所有依赖项
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 分配=https://services.gradle.org/distributions/gradle-5.6.4-all.zip 第二次更新你的kotlin插件 classpath“org.jetbrains.kotlin:kotlin gradle plugin:1.3.61” 第三,将您的android studio更新至最新版本3.6或更高版本 注意:此部分可能显示错误,然后您应该更新约束布局 实现“androidx.constraintlayout:constraintlayout:2.0.0-beta3”
我希望你能解决它最后,我通过提高互联网速度来解决它。 这是因为互联网问题。作为常规的互联网,它也带来了问题。但是当我提高网速的时候,问题就解决了
现在它工作正常。谢谢你的建议。