1

I updated Android Studio to 1.4.1 version. gradle sync said needs to version 2.2.1. I downloaded gradle 2.2.1 and in file-->settings-->gradle set use default gradle wrapper and in 'project location/gradle/wrapper/gradle-wrapper.properties' set distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip.

but android studio has errors:

Error:A problem occurred configuring root project 'Scanner'.

Could not resolve all dependencies for configuration ':classpath'. Could not resolve com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api. Required by: :Scanner:unspecified > com.android.tools.build:gradle:2.2.1 > com.android.tools.build:gradle-core:2.2.1 Could not resolve com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api. Could not parse POM https://jcenter.bintray.com/com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.pom Content is not allowed in prolog.

what is problem? and how can solve this?

gradle file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Fahim
  • 384
  • 5
  • 20

1 Answers1

1

If you are behind a proxy, try Gradle proxy configuration. From the error log you posted it looks like gradle is not able to resolve addresses. Make sure gradle has internet access.

Also you can try the following change in jcenter().

buildscript {
repositories {
    jcenter {
        url "http://jcenter.bintray.com/"
    }
  }
}

allprojects {
repositories {
    jcenter {
        url "http://jcenter.bintray.com/"
    }
  }
}

This many a times fixes the issue.

Shridhar R Kulkarni
  • 6,653
  • 3
  • 37
  • 57