首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android Studio未找到库

Android Studio未找到库
EN

Stack Overflow用户
提问于 2018-10-25 02:26:43
回答 2查看 1.5K关注 0票数 2

当我尝试构建这个项目时,我遇到了许多新的Android Studio版本(3.2.1)的问题。

我正在使用android-向日葵(喷气背包集成)项目,我得到了以下错误。

是不是其他人得到了这个错误?

代码语言:javascript
复制
 Plugin [id: 'com.diffplug.gradle.spotless', version: '3.13.0'] was not found in any of the following sources:

    - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
    - Plugin Repositories (could not resolve plugin artifact 'com.diffplug.gradle.spotless:com.diffplug.gradle.spotless.gradle.plugin:3.13.0')
      Searched in the following repositories:
        Gradle Central Plugin Repository
    Open File
EN

回答 2

Stack Overflow用户

发布于 2018-10-25 02:47:01

根据您的项目的顶级build.gradle文件对其进行调整。添加插件和spotless。

代码语言:javascript
复制
buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

plugins {
id "com.diffplug.gradle.spotless" version "3.4.0"
}

allprojects {
repositories {
    jcenter()
}

buildscript {
    repositories {
        maven { url "https://plugins.gradle.org/m2/" }
    }
}

apply plugin: 'com.diffplug.gradle.spotless'

spotless {
    java {
        target "**/*.java"
        trimTrailingWhitespace()
        removeUnusedImports()
        googleJavaFormat()
    }
}
 }

task clean(type: Delete) {
delete rootProject.buildDir
}
票数 0
EN

Stack Overflow用户

发布于 2018-10-25 02:48:01

Spotless documentary在使用它时这样说:

要在构建脚本中使用它,只需添加Spotless依赖项,并按如下方式进行配置:

代码语言:javascript
复制
spotless {
  format 'misc', {
    target '**/*.gradle', '**/*.md', '**/.gitignore'

    trimTrailingWhitespace()
    indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
    endWithNewline()
  }
  format 'cpp', {
    target '**/*.hpp', '**/*.cpp'

    replace      'Not enough space after if', 'if(', 'if ('
    replaceRegex 'Too much space after if', 'if +\\(', 'if ('

    // Everything before the first #include or #pragma will
    // be replaced with whatever is in `spotless.license.cpp`
    licenseHeaderFile 'spotless.license.cpp', '#'
  }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52975725

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档