找不到com.android.tools.build.gradle:3.0.0-alpha7 [英] Could not find com.android.tools.build.gradle:3.0.0-alpha7

查看:82
本文介绍了找不到com.android.tools.build.gradle:3.0.0-alpha7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将gradle插件更新为最新版本,并且出现此错误:

I update the gradle plugin to the latest, and i'm getting this error:

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

这是我的build.gradle

Here's my 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()
    }
}

我在哪里弄错了?因为我根据问题

Where i'm getting wrong? since i modified my gradle.build according to the question Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci thank you!!

-根据Tim先生更新了build.gradle,但我仍然遇到相同的错误

-- Updated the build.gradle according to Mr Tim, but i'm still having the same error

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

推荐答案

按照

更新gradle版本

新的Android插件需要Gradle版本4.1-milestone-1或 更高.如果要使用Android Studio 3.0打开现有项目 预览5或更高版本,请按照提示自动更新 现有项目到Gradle的兼容版本.

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.

要手动更新Gradle,请更新gradle-wrapper.properties中的URL 如下:

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

应用插件

如果您要使用Android打开现有项目 Studio 3.0 Preview 5或更高版本,请按照提示自动进行 将您的项目更新为最新版本的Android插件.到 手动更新您的项目,包括Maven repo并更改 项目级build.gradle文件中的插件版本,如下所示:

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

  dependencies {

    classpath 'com.android.tools.build:gradle:3.2.1'  //Minimum supported Gradle version is 4.6
  } 
}

这篇关于找不到com.android.tools.build.gradle:3.0.0-alpha7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆