Не удалось найти метод buildConfig () для аргументов корневого проекта - PullRequest
0 голосов
/ 17 декабря 2018

Вот мой файл сборки Gradle, но появляется следующая ошибка -

Could not find method buildConfig() for arguments [build_bkix1el12dgxkzcozxb0vbhet$_run_closure3@7b09d775] on root project 'test2' of type org.gradle.api.Project.

файл сборки.

plugins {
    // Apply the java-library plugin to add support for Java Library
    id 'java-library'
    id 'de.fuerstenau.buildconfig' version '1.1.8' apply false
    id 'eclipse'
}

dependencies {
    // This dependency is exported to consumers, that is to say found on their compile classpath.
    api 'org.apache.commons:commons-math3:3.6.1'

    // This dependency is used internally, and not exposed to consumers on their own compile classpath.
    implementation 'com.google.guava:guava:23.0'

    // Use JUnit test framework
    testImplementation 'junit:junit:4.12'
}

// In this section you declare where to find the dependencies of your project
repositories {
    // Use jcenter for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
    mavenLocal()    
    mavenCentral()
    maven { url "https://jitpack.io" }
}

buildConfig {
  packageName = "test2"
  clsName = "BuildConfig"
}

1 Ответ

0 голосов
/ 17 декабря 2018

См.

id 'de.fuerstenau.buildconfig' version '1.1.8' apply false

Вы не применяете этот плагин (apply false), поэтому расширение buildConfig не создано, это объясняет полученную ошибку.

Выследует удалить параметр apply false в объявлении плагина, если вы хотите применить и использовать / настроить этот плагин.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...