2017-10-14 57 views
0

我已经尝试添加该代码摇篮文件尝试使用谷歌翻译API,但得到一个错误DuplicateFileException:复制在APK project.properties复制的文件

compile ('com.google.cloud:google-cloud-translate:0.5.0') { 
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' 

}

但它给我更多的错误。

所以编译后的主要错误是像 enter image description here

是它的gradle中/依赖条件问题,或者是在认证过程中出了问题?

回答

0

答案是在添加的gradle

 packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/io.netty.versions.properties' 
     exclude 'META-INF/INDEX.LIST' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'project.properties' <------------------------here 
    } 
相关问题