3

Maybe my question looks easy at fist sight, but I'm pretty sure many developers face this problem.

Ok, the problem is that each time I update my Android Studio (Currently has been updated to 2.2 Preview 3) and open my old solutions, I face problems with the gradle version.

As it is mentiond here:

Caution: You should not use dynamic dependencies in version numbers, such as 'com.android.tools.build:gradle:2.+'. Using this feature can cause unexpected version updates and difficulty resolving version differences.

I'm not going to set it as something like 2.+

I want to know how can I find the latest version and set it in the Build.gradle file. Or if the is any other option to not to face this problem every time.

Build.gradle

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.14'
    classpath 'com.google.gms:google-services:1.5.0-beta2'

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

Sync Error

Error:Could not find com.android.tools.build:gradle:2.14.
Searched in the following locations:
    file:/E:/Android/android-studio/gradle/m2repository/com/android/tools/build/gradle/2.14/gradle-2.14.pom
    file:/E:/Android/android-studio/gradle/m2repository/com/android/tools/build/gradle/2.14/gradle-2.14.jar
    https://jcenter.bintray.com/com/android/tools/build/gradle/2.14/gradle-2.14.pom
    https://jcenter.bintray.com/com/android/tools/build/gradle/2.14/gradle-2.14.jar
Required by:
    :ProjectName:unspecified
SalmanShariati
  • 3,873
  • 4
  • 27
  • 46

0 Answers0