使用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‘) } } }