Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find com.android.tools.build.gradle:3.0.0-alpha7

I update the gradle plugin to the latest, and i'm getting this error:

Error:Could not find com.android.tools.build.gradle:3.0.0-alpha7:. Searched in the following locations:     file:/C:/Users/dmin/Documents/android-studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.pom     file:/C:/Users/dmin/Documents/android-studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.jar     https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.pom     https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.jar     https://maven.google.com/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.pom     https://maven.google.com/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.jar 

Here's my build.gradle

buildscript {     repositories {         jcenter()         maven { url 'https://maven.google.com' }     }     dependencies {         classpath 'com.android.tools.build.gradle:3.0.0-alpha7'         classpath 'com.google.gms:google-services:3.1.0'     } }  allprojects {     repositories {         jcenter()     } } 

Where i'm getting wrong? since i modified my gradle.build according to the question Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci thank you!!

-- Updated the build.gradle according to Mr Tim, but i'm still having the same error

buildscript {     repositories {         jcenter()         google()     }     dependencies {         classpath 'com.android.tools.build.gradle:3.0.0-alpha7'         classpath 'com.google.gms:google-services:3.1.0'     } }  allprojects {     repositories {         jcenter()     } } 
like image 635
Nizar Avatar asked Jul 19 '17 11:07

Nizar


People also ask

Is it OK to delete .gradle folder?

Inside the project you can find the . gradle folder. Inside you can find all settings and other files used by gradle to build the project. You can delete these files without problems.

How do I comment in build gradle file?

what is the syntax for writing comments in build. gradle file? For Kotlin scripts (. kts files), it is the same as the regular Kotlin files: // for single-line comment and /* */ for multi-line comments and /** */ for KDoc comments.


2 Answers

Follow the steps in the 3.0.0 plugin migration guide

Update gradle version

The new Android plugin requires Gradle version 4.1-milestone-1 or higher. If you're opening an existing project using Android Studio 3.0 Preview 5 or later, follow the prompts to automatically update an existing project to the compatible version of Gradle.

To update Gradle manually, update the URL in gradle-wrapper.properties as follows:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip 

and

Apply the plugin

If you're opening an existing project using Android Studio 3.0 Preview 5 or later, follow the prompts to automatically update your project to the latest version of the Android plugin. To manually update your project, include the maven repo and change the plugin version in your project-level build.gradle file as follows:

buildscript {   repositories {     ...     // You need to add the following repository to download the     // new plugin.     jcenter()     google()   }    dependencies {      classpath 'com.android.tools.build:gradle:3.2.1'  //Minimum supported Gradle version is 4.6   }  } 
like image 130
Tim Avatar answered Sep 18 '22 20:09

Tim


You try :

buildscript {     repositories {         ...         // You need to add the following repository to download the         // new plugin.         google()     }      dependencies {         classpath 'com.android.tools.build:gradle:3.0.1'     } } 

Credits: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html

like image 30
Pong Petrung Avatar answered Sep 19 '22 20:09

Pong Petrung