0

I Just update my android studio preview 3.0 canary 3. After this I am trying to run the project but showing following error.

Error:Could not find com.android.tools.build:gradle:3.0.0.
Searched in the following locations:
    file:/opt/android-studio-preview/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
    file:/opt/android-studio-preview/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Required by:
    project :
Rolf ツ
  • 8,611
  • 6
  • 47
  • 72
Kailas Bhakade
  • 1,902
  • 22
  • 27
  • You should read here to be sure that you have migrated to the new plugin correctly: https://developer.android.com/studio/preview/features/new-android-plugin-migration.html – MatPag Jun 05 '17 at 08:30
  • I rolled back the question to the original question, you should not change the question after asking it. – Rolf ツ Aug 30 '17 at 11:22

2 Answers2

6

The main things you need to do are:

Change your project level build.gradle file to:

buildscript {
    repositories {
        ...
        // You need to add the following repository to download the
        // new plugin.
        maven {
          url 'https://maven.google.com'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
    }
}

Change the distributionUrl of your gradle-wrapper.properties to the currently latest available release of Gradle.

distributionUrl=https://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip

After this steps your project could not compile yet, and you need to follow all the instructions here on how to convert your app build.gradle to the new plugin

MatPag
  • 41,742
  • 14
  • 105
  • 114
0

Change your build.gradle (project_name) 's one line(classpath) as per update:-

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha3'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
Nitin Patel
  • 1,605
  • 13
  • 31