Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > duplicate entry: com/google/protobuf/AbstractMessageLite$Builder$LimitedInputStream.class #1360

Closed
ManuBabu opened this issue Nov 1, 2016 · 12 comments
Assignees
Labels
android api: translation Issues related to the Cloud Translation API API.

Comments

@ManuBabu
Copy link

ManuBabu commented Nov 1, 2016

Hi, i am getting this error when i run my app with 'com.google.cloud:google-cloud-translate:0.5.0' dependency.

Note: when i build my app, it gives 8 warnings with zero errors but when i run i am getting this error: **"Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/protobuf/AbstractMessageLite$Builder$LimitedInputStream.class**

how can i resolve it??/

@mziccard
Copy link
Contributor

mziccard commented Nov 1, 2016

Hi @ManuBabu,

Please notice that we do not explicitly support Android.

The information you provide is not enough to understand what is going on. How can you say that this problem is related to google-cloud-translate? Could you please share the full stack trace, and also the warnings you are getting when building the app?

@ManuBabu ManuBabu changed the title Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > duplicate entry: com/google/protobuf/AbstractMessageLite$Builder$LimitedInputStream.class Nov 1, 2016
@ManuBabu
Copy link
Author

ManuBabu commented Nov 1, 2016

Hi @mziccard ,
i am getting this error, when i add com.google.cloud:google-cloud-translate:0.5.0' in my project,
if i remove this dependency and build again it will removes the errors and warnings also.

@mziccard
Copy link
Contributor

mziccard commented Nov 1, 2016

@ManuBabu the errors you provided are not enough to understand what's going on, can you share more information?

@ManuBabu
Copy link
Author

ManuBabu commented Nov 1, 2016

@mziccard Sure,

i am trying to implement language translate feature in my app, so to implement this feature i am using Gradle Dependency :"com.google.cloud:google-cloud-translate:0.5.0" after syncing the dependencies i am getting following warnings:

After Syncing
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20151123 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20151123 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20151123 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20151123 is ignored for release as it may be conflicting with the internal version provided by Android.
Information:BUILD SUCCESSFUL

Information:Total time: 4.54 secs
Information:0 errors
Information:8 warnings
Information:See complete output in console

when i run the project after sync i am getting following error:

duplicate entry: com/google/protobuf/AbstractMessageLite$Builder$LimitedInputStream.class

Errors after running my project

Information:Gradle tasks [:app:assembleDebug]
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20151123 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20151123 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20151123 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20151123 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
**Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/protobuf/AbstractMessageLite$Builder$LimitedInputStream.class**

Information:BUILD FAILED
Information:Total time: 38.0 secs
Information:1 error
Information:9 warnings
Information:See complete output in console

@mziccard
Copy link
Contributor

mziccard commented Nov 1, 2016

@ManuBabu try to include google-cloud-translate while excluding grpc-protobuf-lite, this should get rid of duplicated classes:

compile ('com.google.cloud:google-cloud-translate:0.5.0') {
    exclude group: 'io.grpc', module: 'grpc-protobuf-lite'
}

@ManuBabu
Copy link
Author

ManuBabu commented Nov 2, 2016

Hey @mziccard , i tried with the solution you provided, still i'm getting same errors as mentioned in the above comment. i tried the given solution in my project as well as new project. i am getting same error. :(

@ManuBabu
Copy link
Author

ManuBabu commented Nov 2, 2016

could you please create fresh sample project and check by adding dependency. so that you can understand the issue better.

@mziccard
Copy link
Contributor

mziccard commented Nov 2, 2016

Here you can find a working Android application using google-cloud-translate.
Notable things in the app's build.gradle are:

  • Enable multidex:
    defaultConfig {
        ...
        multiDexEnabled true
    }
  • Force findbugs resolution strategy:
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }
  • Exclude duplicate files:
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/io.netty.versions.properties'
        exclude 'META-INF/INDEX.LIST'
    }
  • Import google-cloud-translate avoiding duplicates:
    compile ('com.google.apis:google-api-services-translate:v2-rev47-1.22.0') {
        exclude group: 'com.google.guava'
    }
    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'
    }

Hope this helps.

@tiendatit92
Copy link

Hi ManuBabu, I have installed google cloud translate 0.5.0, but it have a lot of issues, same Mizccard's problem, can you show to me solution for this issuse?, thanks you

@mziccard
Copy link
Contributor

mziccard commented Nov 2, 2016

@tiendatit92 Have a look at this example for a working Android app using google-cloud-translate 0.5.0.

@ManuBabu
Copy link
Author

@tiendatit92 hi sorry for late reply, i just changed com.google.android.gms:play-services to 9.6.0 version. and added force to it.

@ManojJangra
Copy link

Hi,
We are getting this error...... Please suggest me in the same

Thanks.

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\0.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\1.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\3.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\4.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\5.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\6.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\7.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\8.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\9.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\11.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\12.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\13.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\14.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\15.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\16.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\17.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\18.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\19.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\20.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\21.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\22.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\23.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\24.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\25.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\26.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\27.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\28.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\29.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\30.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\31.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\32.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\33.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\34.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\35.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\36.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\37.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\38.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\39.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\40.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\41.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\42.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\43.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\44.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\45.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\46.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\47.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\48.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\49.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\50.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\51.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\52.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\53.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\54.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\55.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\56.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\57.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\58.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\59.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\60.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\61.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\62.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\63.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\64.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\65.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\66.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\67.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\68.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\69.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\70.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\71.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\72.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\73.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\74.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\75.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\76.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\77.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\78.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\79.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\80.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\81.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\82.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\83.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\84.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\85.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\86.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\87.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\88.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\89.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\90.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\91.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\92.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\93.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\94.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\95.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\96.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\97.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\98.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\99.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\100.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\101.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\102.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\103.jar, D:\clone-applications\NexGTv_Youtube\nexgtv-android-youtube\app\build\intermediates\transforms\dexBuilder\debug\104.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android api: translation Issues related to the Cloud Translation API API.
Projects
None yet
Development

No branches or pull requests

5 participants