android - 运行发布构建时出现异常'处理任务java.io.IOException时出现异常:'如何解决这个问题?
问题描述
我正在使用谷歌云语音到文本 api,如果我得到这样的发布构建抛出异常Exception while processing task java.io.IOException:
。
例外
Warning: Exception while processing task java.io.IOException: Can't write [D:\Workspace\Projects\t-wise\app\build\intermediates\transforms\proguard\release\0.jar] (Can't read [D:\Workspace\Projects\t-wise\app\build\intermediates\javac\release\compileReleaseJavaWithJavac\classes(;;;;;;;**.class)] (Can't read [com] (Can't read [google] (Can't read [protobuf] (Can't read [Any$1.class] (Duplicate jar entry [com/google/f/f$1.class]))))))
我的毕业档案
apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'
ext {
grpcVersion = '1.12.0'
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.1"
flavorDimensions "default"
multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
buildTypes {
debug {
minifyEnabled false
multiDexEnabled true
}
release {
minifyEnabled true
shrinkResources false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/io.netty.versions.properties'
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/com.google.f'
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
dexOptions {
javaMaxHeapSize "Xg"
}
//
/* productFlavors {
dev {
// Minimum version with platform multi-dex support
minSdkVersion 21
}
prod {
// Minimum version that can run gRPC (TLS extension)
minSdkVersion 16
}
}*/
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:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.cloud:google-cloud-translate:1.65.0'
// add these dependencies for the speech client
// gRPC
implementation 'io.grpc:grpc-okhttp:1.12.0'
implementation 'io.grpc:grpc-stub:1.12.0'
implementation 'javax.annotation:javax.annotation-api:1.2'
protobuf 'com.google.protobuf:protobuf-java:3.3.1'
implementation 'com.google.cloud:google-cloud-speech:0.53.0-alpha'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'org.conscrypt:conscrypt-android:2.1.0'
}
如何解决这个错误,请任何人给我一个解决方案。
提前谢谢...
解决方案
推荐阅读
- python - NoneType' 对象没有属性 'winner' PYTHON CHECKERS GAME
- c# - 如何在跳转列表中获取之前添加的项目
- django - 如何使用选定字段制作我的第一个表单,在 Django 的第二个表单中预填充该字段
- authentication - 无法使用主域凭据登录 keycloak
- r - 使用 POSIXct 和 POSIXt 进行模糊连接
- react-native - 我应该将 useMemo 与 React Native Webview 一起使用吗?
- regex - 正则表达式:如何检查字符串是否为空或空白且不包含字符“<”和“>”?
- javascript - 按嵌套对象属性对对象数组进行排序
- ios - 有什么方法可以在运行时更改 ios 上推送通知的权限?
- python - Python列表理解,查找表