Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

could not find gradle 3.0.0-alpha4

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:Could not find com.android.tools.build:gradle:3.0.0-alpha4.
Searched in the following locations:
    file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.pom
    file:/C:/Program Files/Android/Android Studio/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.jar
Required by:
    project :
like image 652
Tornike Kurdadze Avatar asked Jun 20 '17 06:06

Tornike Kurdadze


2 Answers

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' }
        }
    }
like image 61
IntelliJ Amiya Avatar answered Nov 11 '22 15:11

IntelliJ Amiya


A better way may be just to use

buildscript {
    repositories {
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }
}
like image 2
Diego Plentz Avatar answered Nov 11 '22 16:11

Diego Plentz