AS使用问题

Posted 穿越银河系

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AS使用问题相关的知识,希望对你有一定的参考价值。

使用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使用问题的主要内容,如果未能解决你的问题,请参考以下文章

latex在vim中的代码片段

有人可以解释以下 R 代码片段吗? [关闭]

使用 with as 优化SQL

无法将其他flas动画片段访问到动作脚本3

sql里面 with...as 是啥意思啊?如何使用

R 知识片段