2017-07-19 24 views
11

zaktualizować Gradle wtyczki do najnowszych, a ja dostaję ten błąd:Nie można znaleźć com.android.tools.build.gradle: 3.0.0 alfa7

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 

Oto mój 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() 
    } 
} 

Gdzie się mylę? odkąd zmodyfikowałem mój gradle.build zgodnie z pytaniem Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci dziękuję !!

- Poprawiono build.gradle według pana Tim, ale nadal mam ten sam błąd

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

Możliwy duplikat [Nie można znaleźć com.android.tools.build:gradle:3.0.0-alpha1 w kółku ci] (https://stackoverflow.com/questions/44071080/cou ld-not-find-com-android-tools-buildgradle3-0-0-alpha1-in-circle-ci) –

+0

Przynajmniej załóż trochę badań, zanim napiszesz takie pytanie! Odpowiedź już tam jest. –

+0

tak mam android studio 3 kanarek 7 zainstalowany – Nizar

Odpowiedz

19

Wykonaj kroki w 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 

i

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

Zaktualizowałem moje pytanie, czy możesz mi pomóc? – Nizar

+0

@Nizar zaktualizowałeś również wrapper gradle –

1
  1. otwórz ścieżkę pliku (tak jak lo g wspomniany) file:/C:/Users/dmin/Documents/android-studio/gradle/m2repository/com/android/tools/build/gradle/
  2. found this file

  3. wystarczy zmienić classpath 'com.android.tools.build.gradle:3.0.0-alpha7' do classpath 'com.android.tools.build.gradle:* * * '; * * * to istniejący plik gradle;

    ten problem jest z powodu Gradle pliku nie znaleziono

1

własnością distributionUrl wewnątrz gradle-wrapper.properties powinny być:

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

że pracuje dla mnie

1

zaktualizować plugin Gradle: w pliku gradle.properties dodać tę linię distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

następnie zastosować wtyczkę ther w pliku build.gradle:

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

}