android – Could not resolve androidx.databinding:databinding-compiler:3.5.3-ThrowExceptions

Exception or error:

I just Convert my project to androidX and project build successfully. But when I want to run that time it’s created this error in android studio 3.5.3 with java enabled.

Here’s my project 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" }
    }
}

My module gradle file: All dependency I add here.

     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

Build output: Here pom details not download when running the application

 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.
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *