找不到 gradle 3.0.0-alpha4 [英] could not find gradle 3.0.0-alpha4

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

问题描述

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

a few days ago i have installed android studio 3.0 (preview) and after that in stable version (studio 2.3.3) when i try to import project it give me an error. In preview everything works fine. this is an error:

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 :

推荐答案

如果您使用 Android Studio 3.0 预览版打开现有项目1 或更高版本,按照提示自动将您的项目更新为最新版本的 Android 插件.手动更新您的项目,包括 maven repo 并更改您的插件版本项目级 build.gradle 文件如下:

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 部分.

Open your Project level build.gradle Section .

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

You should add 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' }
        }
    }

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

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