could not find gradle 3.0.0-alpha4
阿新 • • 發佈:2019-02-01
a few days ago i have installed android studio 3.0 (preview) and after that in stable version (studio 2.3.3) when i try to import project it give me an error. In preview everything works fine. this is an error:
Error:Couldnot find com.android.tools.build:gradle:3.0.0-alpha4.Searchedin the following locations :
file:/C:/ProgramFiles/Android/AndroidStudio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.pom
file:/C:/ProgramFiles/Android/AndroidStudio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.jarRequiredby:
project :
解決方案:
If you're opening an existing project using Android Studio 3.0 Preview 1 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:
Open your Project level build.gradle
Section .
You should add maven { url 'https://maven.google.com' }
.
Example
buildscript {
repositories {
jcenter()// 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-alpha4'// Same for alpha6}}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com'}}}