Тип программы уже представлен: com.google.protobuf.AbstractProtobufList - PullRequest
0 голосов
/ 13 декабря 2018

Я запускаю эту ошибку и не могу запустить облако Google.Тип программы уже существует: com.google.protobuf.AbstractProtobufList

Я не могу выяснить, какая другая зависимость имеет AbstractProtobufList.Я новичок в ProtobufGradle Sync нет проблем.Но когда я запускаю проект, он выдает ошибку.Я даже включил multidex и добавил зависимость multidex.

Файл Gradle:

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

 ext {
 grpcVersion = '1.4.0'
 }
 android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.SpeechServiceDemo"
    minSdkVersion 21
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled  true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
}

protobuf {

protoc {
    // You still need protoc like in the non-Android case
    artifact = 'com.google.protobuf:protoc:3.0.0'
}
plugins {
    javalite {
        // The codegen for lite comes as a separate artifact
        artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
    }
}
generateProtoTasks {
    all().each { task ->
        task.builtins {
            // In most cases you don't need the full Java output
            // if you use the lite output.
            remove java
        }
        task.plugins {
            javalite {}
        }
    }
}
}



dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
     implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'


compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'


//AzureDepedencies
implementation 'com.microsoft.cognitiveservices.speech:client-sdk:1.1.0'
//end

//GoogleCloudSpeechServices

// gRPC
compile "io.grpc:grpc-okhttp:$grpcVersion"
compile "io.grpc:grpc-protobuf-lite:$grpcVersion"
compile "io.grpc:grpc-stub:$grpcVersion"
compile 'javax.annotation:javax.annotation-api:1.2'
protobuf 'com.google.protobuf:protobuf-lite:3.0.1'

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

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

compile 'com.android.support:multidex:1.0.3'
//end

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'
}
...