android - 找不到 gradle 3.0.0-alpha4

标签 android android-studio gradle android-gradle-plugin

几天前,我安装了 android studio 3.0(预览版),之后安装了稳定版(studio 2.3.3),当我尝试导入项目时出现错误。 在预览中一切正常。 这是一个错误:

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 :

最佳答案

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:

打开您的项目级别 build.gradle 部分。

您应该添加 maven { url 'https://maven.google.com' }

示例

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

关于android - 找不到 gradle 3.0.0-alpha4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44645099/

相关文章:

php - POST 请求中的字符编码错误

android - 用于和发布管理的 Gradle 构建变体和风格

Android Wearable Message API 根本不起作用

java - Java语言的Android EMI计算器: Not resulting correct as Math. pow给出了非常大的数字

java - 我想实现一个搜索栏,它将接受一个字符串,然后它将过滤填充的 ListView 或在服务器上搜索该字符串

android - DeepLinkDispatch - 不兼容的类型 : List<Object> cannot be converted to List<DeepLinkEntry>

android - 如何将 Android Studio 设置为完全离线工作?

java - 删除 gradle 中的传递类路径依赖

java - Gradle 测试,详细运行?

Angular 抛出错误 "Couldn' t 跟随符号链接(symbolic link)”