使用google-cloud-speech时,在APK project.properties中复制的文件重复

时间:2017-06-20 07:34:21

标签: java android google-cloud-speech

  

我在我的应用中使用 google-cloud-speech 时出错。我不能   找到任何解决方案。

Duplicate files copied in APK project.properties when use google-cloud-speech

错误日志:

Error:Execution failed for task 
':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: 
com.android.builder.packaging.DuplicateFileException: Duplicate files copied 
in APK project.properties
File1: C:\Users\User\.gradle\caches\modules-2\files-
2.1\com.google.cloud\google-cloud-speech\0.17.1-
alpha\465fbf7a46b1b1fc3ecc8bb0371bdde7148242fd\google-cloud-speech-0.17.1-
alpha.jar
File2: C:\Users\User\.gradle\caches\modules-2\files-
2.1\com.google.cloud\google-cloud-
core\1.0.0\a204545d321c4f1688d9c377cdd88310884842f4\google-cloud-core-
1.0.0.jar

我尝试了以下两种方式,但它不起作用。 谁能告诉我如何解决这个问题!!

提前谢谢!

之一:

    compile ('com.google.cloud:google-cloud-speech:0.17.1-alpha'){
    exclude group: 'org.json'
    exclude group: 'org.apache.httpcomponents'
    exclude group: 'io.grpc', module: 'grpc-all'
    exclude group: 'com.google.protobuf', module: 'protobuf-java'
    exclude group: 'com.google.api-client', module: 'google-api-client-
 appengine'
    }

2

packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
}

1 个答案:

答案 0 :(得分:3)

请在packagingOptions中添加 exclude' project.properties'