码迷,mamicode.com
首页 > 其他好文 > 详细

AS使用问题

时间:2018-04-04 21:16:40      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:closed   could not   解决方案   ide   dev   项目   option   could   ldd   

使用Android Studio时导入项目提示更新gradle,同意更新后使用FindBugs出现

Error:Gradle: A problem occurred configuring root project ‘k-9-5.201‘.
> Could not resolve all files for configuration ‘:classpath‘.
> Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :

 

解决方案:

https://stackoverflow.com/questions/25994163/could-not-resolve-all-dependencies-for-configuration-classpath

build.gradle 开头部分更改

buildscript {
    repositories {
        jcenter()
        google()
    }

    dependencies {
        classpath com.android.tools.build:gradle:3.0.1
    }
}

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

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

完整的

技术分享图片
buildscript {
    repositories {
        jcenter()
        google()
    }

    dependencies {
        classpath com.android.tools.build:gradle:3.0.1
    }
}

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

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

project.ext {
    testCoverage = project.hasProperty(testCoverage)
    optimizeForDevelopment = project.hasProperty(optimizeForDevelopment) && optimizeForDevelopment == true
}

subprojects {
    project.plugins.whenPluginAdded { plugin ->
        if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name) ||
                "com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
            project.android.dexOptions.preDexLibraries = !rootProject.hasProperty(disablePreDex)
        }
    }
}
build.gradle

 

AS使用问题

标签:closed   could not   解决方案   ide   dev   项目   option   could   ldd   

原文地址:https://www.cnblogs.com/wangkaipeng/p/8718465.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!