Gradle在Android SDK canary 4中构建FAILD

时间:2017-06-19 06:54:25

标签: android maven gradle android-gradle build.gradle

当我尝试在常规Android SDK版本上构建我的项目时,它没有任何问题,但是当我使用Android SDK预览版 Canary 4 时,我收到此错误

>       Error:Could not find com.android.tools.build:gradle:3.0.0-alpha2.
>     Searched in the following locations:
>         file:/C:/Program Files/Android/Android Studio Preview/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha2/gradle-3.0.0-alpha2.pom
>         file:/C:/Program Files/Android/Android Studio Preview/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha2/gradle-3.0.0-alpha2.jar
>         https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha2/gradle-3.0.0-alpha2.pom
>         https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha2/gradle-3.0.0-alpha2.jar
>     Required by:
>         project :

2 个答案:

答案 0 :(得分:0)

您尝试使用新版Gradle。为此,您应该在gradle-wrapper.properties文件中更改distributionUrldistributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip(project / gradle - > wrapper - > gradle-wrapper.properties)

答案 1 :(得分:0)

将distributionUrl和gradle更新为

  

'com.android.tools.build:grad:3.0.0-alpha4'

可能会帮到你。