Android Studio не найдена. Библиотеки - PullRequest
0 голосов
/ 24 октября 2018

У меня было много проблем с новой версией Android Studio (3.2.1), когда я пытался собрать проект.

Я работаю с проектом android-sunflower (интеграция с Jetpack) ипоявляется следующая ошибка.

Кто-то еще получает эту ошибку?

 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

Ответы [ 2 ]

0 голосов
/ 24 октября 2018

Spotless документальный фильм произнесите это для его использования:

Чтобы использовать его в вашем buildscript, просто добавьте зависимость Spotless и настройте его следующим образом:

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 голосов
/ 24 октября 2018

Адаптируйте его для вашего файла build.gradle верхнего уровня для вашего проекта.Добавить плагины и безупречно.

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
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...