2017-07-19 1 views
11

ich das gradle Plugin, um das neueste Update, und ich diesen Fehler:konnte nicht com.android.tools.build.gradle finden: 3.0.0-alpha7

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 

Hier ist mein 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() 
    } 
} 

Wo ich falsch liege? seit ich mein grandle.build entsprechend der Frage Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci änderte, danke !!

- Aktualisiert die build.gradle nach Herrn Tim, aber ich habe immer noch die gleichen Fehler

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() 
    } 
} 
+2

Mögliches Duplikat von [Konnte com.android.tools.build:gradle:3.0.0-alpha1 im Kreis ci nicht finden] (https://stackoverflow.com/questions/44071080/cou ld-nicht-finden-com-android-tools-buildgradle3-0-0-alpha1-in-circle-ci) –

+0

Zumindest einige Forschung vor dem Posten solcher Frage! Es ist die Antwort schon da. –

+0

ja ich habe android studio 3 kanarienvogel 7 installiert – Nizar

Antwort

19

Folgen Sie den Schritten in der 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 

und

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. 
    google() 
    } 

    dependencies { 
    classpath 'com.android.tools.build:gradle:3.0.0-alpha5' 
    } 
} 
+0

Ich habe meine Frage aktualisiert, können Sie mir bitte helfen? – Nizar

+0

@Nizar hast du auch den Wrapper aktualisiert –

1
  1. Öffnen Sie den Dateipfad (genau wie der lo g gesagt): file:/C:/Users/dmin/Documents/android-studio/gradle/m2repository/com/android/tools/build/gradle/
  2. found this file

  3. nur classpath 'com.android.tools.build.gradle:3.0.0-alpha7' classpath 'com.android.tools.build.gradle:* * * ' ändern; * * * ist die existierende Gradle-Datei;

    dieses Problem wegen gradle Datei ist nicht

    gefunden
1

die distributionUrl Eigenschaft innerhalb gradle-wrapper.properties sollte sein:

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

, die für mich

1

aktualisieren gradle Plugin funktioniert:

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' 
} 

}

: in gradle.properties diese Zeile distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

dann ther-Plugin in build.gradle Datei hinzufügen Datei anwenden