Конфигурация 'debugCompile' напрямую не разрешена с помощью Gcloud - PullRequest
0 голосов
/ 08 декабря 2018

Я видел много вопросов по этой теме, но ничего не помогло, я новичок в Android, я пытаюсь использовать Gcloud Speech API, я получаю:

  • Что пошло не так: не удалось определить зависимости задачи': приложение: extractIncludeDebugProto.

    Разрешение конфигурации 'debugCompile' напрямую не разрешено

мой файл gradle: Moudle: app:

apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'

ext {
    grpcVersion = '1.4.0'
}
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.atheel.tamkeengcloud"
        minSdkVersion 17
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
    }
}
protobuf {
    protoc {
        artifact = 'com.google.protobuf:protoc:3.3.0'
    }
    plugins {
        javalite {
            artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"
        }
        grpc {
            artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
        }
    }
    generateProtoTasks {
        all().each { task ->
            task.plugins {
                javalite {}
                grpc {
                    // Options added to --grpc_out
                    option 'lite'
                }
            }
        }
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// gRPC
    implementation "io.grpc:grpc-okhttp:$grpcVersion"
    implementation "io.grpc:grpc-protobuf-lite:$grpcVersion"
    implementation "io.grpc:grpc-stub:$grpcVersion"
    implementation 'javax.annotation:javax.annotation-api:1.2'
    protobuf 'com.google.protobuf:protobuf-java:3.3.1'

    implementation group: 'com.google.api.grpc', name: 'grpc-google-cloud-speech-v1', version: '0.1.13'

    // OAuth2 for Google API
    implementation('com.google.auth:google-auth-library-oauth2-http:0.7.0') {
        exclude module: 'httpclient'
    }

    implementation 'com.android.support:multidex:1.0.0'

}

Проект:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.0"

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

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

пожалуйста, помогите.Я застрял

, когда я добавляю:

project.configurations.debugCompile.setCanBeResolved(true)
project.configurations.debugCompile.each {
    println it
}

, как сказано в одном решении, я получаю:

  • Что пошло не так: не удалось определить зависимости задачи ': приложение: extractIncludeAndroidTestProto.

    Разрешение конфигурации 'androidTestCompile' напрямую не разрешено

...