首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法解决androidx.databinding:databinding-compiler:3.5.3

无法解决androidx.databinding:databinding-compiler:3.5.3
EN

Stack Overflow用户
提问于 2020-02-24 09:23:41
回答 2查看 5K关注 0票数 2

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

,这是我的项目梯度:

代码语言:javascript
复制
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文件:我在这里添加的所有依赖项。

代码语言:javascript
复制
     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详细信息

代码语言:javascript
复制
 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.
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-03-04 10:23:47

最后,我通过提高网络速度解决了这个问题。

这是因为网络问题。作为普通的互联网,它制造了问题。但现在我提高了上网速度,问题就解决了。

现在它正常工作了。

票数 2
EN

Stack Overflow用户

发布于 2020-03-04 10:09:53

这些类型的问题可能是因为有些图书馆没有在哈默,所以你应该更新,也许你的问题会消失。我也有同样的问题,现在解决了。

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

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

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

我希望你能解决这个问题

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60372789

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档