https://maven.google.com studio3.0问题

最近都在接触ios的开发,以至于有段时间没打开AS了,然后昨天打开更新了一下,发现居然出现了好多问题,引用的第三方包都不支持了,还让我一个一个的去掉,这是什么情况,WTF。

才发现Android Studio 3.0.0以上已经默认添加google()作为google的远程仓库了。

遇到问题的时候,我还是喜欢先去分析问题的出现,在更新之前是没有问题的,那么就是新版本的AS有问题,AS有问题,我一般都会先检查三个地方。
1、根目录的build.gradle,检查构建工具的版本,是否是正常的

dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta6'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

2、gradle/wrapper/gradle-wrapper.properties里面gradle的版本

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

3、sdk版本,一般检查module下面的build.gradle文件,检查里面的sdk是否不存在,如果是,请下载。

compileSdkVersion 25
    buildToolsVersion localBuildToolsVersion

    aaptOptions.cruncherEnabled = false
    aaptOptions.useNewCruncher = false

    defaultConfig {
        applicationId "com.voctex"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"

        // dex突破65535的限制
        multiDexEnabled true
    }

然后发现这一套下来,居然不管用。。。

AS还老是提示我添加google的远程仓库,没办法,就添加看看吧,结果还是一样的报错,代码如下

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta6'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

这个AS提示我添加的东西居然还是搞不定?这就让我对AS有点无语了,然后上网搜了一下,发现要改成google()才可以,这。。。
具体代码如下:

buildscript {
    repositories {
        jcenter()
        google()
//        maven {
//            url 'https://maven.google.com/'
            url 'https://dl.google.com/dl/android/maven2/'
//            name 'Google'
//        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta6'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

QQ:361561789
有事可以直接加Q联系

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值