zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    200. Number of Islands 200.岛屿数(可以形状一样)
    695. Max Area of Island最大岛屿面积
    springboot如何在项目启动时初始化资源
    springboot之集成Memcached
    springboot之spring-boot-admin对springboot服务进行监控
    springboot之集成FastDFS
    springboot之上传文件
    springboot之整合shiro-登录认证和权限管理
    springboot 如何测试打包部署
    springboot之Mongo
  • 原文地址:https://www.cnblogs.com/wangkaipeng/p/8718465.html
Copyright © 2011-2022 走看看