• 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
  • 相关阅读:
    Vue源码解析
    开发调试的几个小技巧
    C#课后小作业
    C#随堂
    C#是数据类型
    插眼
    SQL基本的45题
    SQL创建数据库、建表、填入内容
    T-SQL语句基础
    SQL基本数据类型等
  • 原文地址:https://www.cnblogs.com/wangkaipeng/p/8718465.html
Copyright © 2020-2023  润新知