Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.0/gradle-4.0.0.pom'

Viewed 3057

i tried everything i could think of but i keep getting this error. this is my gradle build:

buildscript {
repositories {
    jcenter()
    maven{ url "https://dl.bintray.com/android/android-tools" }
    mavenCentral()
}
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"
        classpath 'com.google.gms.google-services:4.3.3'
      // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven{url 'https://www.google.com/'}
        maven { url "https://dl.bintray.com/android/android-tools" }
    }
}


task clean(type: Delete) {
    delete rootProject.buildDir
}


apply plugin: 'com.android.application'

android { compileSdkVersion 30 buildToolsVersion "30.0.0"

defaultConfig {
    applicationId "com.example.textbookexhange"
    minSdkVersion 16
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

}

my gradle wrapper is fine distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip

1 Answers

The reason you are not able to resolve the version 4.0 because the version 4.0 is not available in the JCenter.

https://jcenter.bintray.com/com/android/tools/build/gradle/

Firstly the version 4.0 should be available in your Bintray package in order for it to mirror in the JCenter You can check the same in the below bintray download link: https://dl.bintray.com/android/android-tools/com/android/tools/build/gradle/

Update the version 4.0 under the path "com/android/tools/build/gradle" in your bintray package so that it will be reflected in the JCenter.

Related