我在使用Google cloud stt示例应用程序时出现以下错误
Android studio:应用程序本身已经编译并在另一个中运行
AndroID工作室环境.
编译错误
Program type already present:com.Google.protobuf.AbstractMessagelite$Builder$limitedinputStreamMessage{kind=ERROR, text=Program type already present: com.Google.protobuf.AbstractMessagelite$Builder$limitedinputStream, sources=[UnkNown source file], tool name=Optional.of(D8)}
我的 *** 作系统是ubuntu 16.04,AndroID版是AndroID studio V 3.1.下面
这是一个gradle源.
的build.gradle(项目)
// top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {repositorIEs { jcenter() Google()}dependencIEs { classpath 'com.androID.tools.build:gradle:3.1.0' classpath 'com.Google.protobuf:protobuf-gradle-plugin:0.8.5' // NOTE: Do not place your application dependencIEs here; they belong // in the indivIDual module build.gradle files}}allprojects {repositorIEs { jcenter() Google() mavenCentral()}}task clean(type: Delete) {delete rootProject.buildDir}
build.gradle(模块:app)
apply plugin: 'com.androID.application'apply plugin: 'com.Google.protobuf' ext {grpcVersion = '1.4.0' } androID {compileSdkVersion 26buildToolsversion '27.0.3'defaultConfig { applicationID "com.app.androIDkt.speechAPI" 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' }}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 {compile filetree(dir: 'libs', include: ['*.jar'])androIDTestCompile('com.androID.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.androID.support', module: 'support-annotations'})compile 'com.androID.support:appcompat-v7:26.+'compile 'com.androID.support.constraint:constraint-layout:1.0.2'testCompile 'junit:junit:4.12'compile 'com.jakewharton:butterknife:8.7.0'annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'// gRPCcompile "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-java:3.3.1'compile group: 'com.Google.API.grpc', name: 'grpc-Google-cloud-speech-v1', version: '0.1.13'// OAuth2 for Google Apicompile('com.Google.auth:Google-auth-library-oauth2-http:0.7.0') { exclude module: 'httpclIEnt'}compile 'com.androID.support:multIDex:1.0.0'}
gradle源
compile "io.grpc:grpc-protobuf-lite:$grpcVersion"
评论此部分不会导致错误.与protobuffer和grpc相关的错误,但很难正确解决.
我需要帮助.
解决方法:
我有同样的问题,可以通过在gradle.propertIEs文件中设置Gradle属性来禁用D8工具来暂时解决它:
androID.enableD8=false
我使用的是AndroID Studio 3.2 RC2.
总结以上是内存溢出为你收集整理的android – 程序类型已存在:com.google.protobuf.AbstractMessageLite $Builder $LimitedInputStream全部内容,希望文章能够帮你解决android – 程序类型已存在:com.google.protobuf.AbstractMessageLite $Builder $LimitedInputStream所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)