GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — internal dependency conflict appears when compiling google-cloud-pubsub · Issue #1319 · googleapis/google-cloud-java

internal dependency conflict appears when compiling google-cloud-pubsub #1319

New issue
Copy link
New issue
Copy link
Closed
Closed
internal dependency conflict appears when compiling google-cloud-pubsub#1319
Copy link
Assignees
mziccard

Description

@kir-titievsky
kir-titievsky
opened on Oct 17, 2016
Issue body actions

Reposting this submission to [email protected] as a bug:

The cloud pubsub library is not working with Android Studio 2.2.1 (Build #AI-145.3330264, built on October 6, 2016, JRE: 1.8.0_76-release-b03 amd64, JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o) under Debian (3.2.0-4-amd64 #1 SMP Debian 3.2.81-2 x86_64 GNU/Linux).

I added [compile group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '0.4.0'] to gradle file, but it states the following: "Execution failed for task ':app:prepareDebugAndroidTestDependencies'.>Dependency Error. See console for details."

I checked the console and the output shows the following: "Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (3.0.0) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.".

I tried to solve it by adding the following line to the android{} section of gradle file: "configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.0' }", but it resulted in the following output in console(see below):
"Error:FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

    com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
    File1: /home/debi/.gradle/caches/modules-2/files-2.1/com.google.auto.value/auto-value/1.1/f6951c141ea3e89c0f8b01da16834880a1ebf162/auto-value-1.1.jar
    File2: /home/debi/.gradle/caches/modules-2/files-2.1/org.codehaus.jackson/jackson-core-asl/1.9.11/e32303ef8bd18a5c9272780d49b81c95e05ddf43/jackson-core-asl-1.9.11.jar
    File3: /home/debi/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/4.0/f990a43d3725781b6db7cd0acf0a8b62dfd1649/guice-4.0.jar

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. "

What should I do?

Activity

  1. mziccard commented on Oct 17, 2016

    @mziccard
    mziccard
    on Oct 17, 2016
    Contributor
    More actions

    @kir-titievsky I'll try to have a look at this. First and second errors appear to be unrelated though. Also please, be aware that we do not explicitly support Android at the moment.

    com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE

    This kind of duplication errors seems to be quite common in Android. To avoid duplication you could try adding to your build file:

    packagingOptions {
        exclude 'META-INF/LICENSE'
    }
  2. jfarkhat commented on Oct 17, 2016

    @jfarkhat
    jfarkhat
    on Oct 17, 2016
    More actions

    Hi,

    Just want to update it with the recent gradle configuration:

    Gradle:

    apply plugin: 'com.android.application'

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '0.4.0'
    compile 'com.android.support:appcompat-v7:23.4.0'
    testCompile 'junit:junit:4.12'
    

    }

    android {
    compileSdkVersion 23
    buildToolsVersion '24.0.3'
    defaultConfig {
    applicationId "com.example.debi.pubsub0"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.0'
    }
    
    packagingOptions {
        pickFirst 'META-INF/LICENSE'
        pickFirst  'META-INF/io.netty.versions.properties'
        pickFirst 'META-INF/INDEX.LIST'
    }
    
    /*packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude  'META-INF/io.netty.versions.properties'
        exclude 'META-INF/INDEX.LIST'
    }*/
    

    }

    Console:

    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.
    Error:trouble processing "javax/transaction/HeuristicCommitException.class":
    Error:Ill-advised or mistaken usage of a core class (java.* or javax.*)
    Error:when not building a core library.
    Error:This is often due to inadvertently including a core library file
    Error:in your application's project, when using an IDE (such as
    Error:Eclipse). If you are sure you're not intentionally defining a
    Error:core class, then this is the most likely explanation of what's
    Error:going on.
    Error:However, you might actually be trying to define a class in a core
    Error:namespace, the source of which you may have taken, for example,
    Error:from a non-Android virtual machine project. This will most
    Error:assuredly not work. At a minimum, it jeopardizes the
    Error:compatibility of your app with future versions of the platform.
    Error:It is also often of questionable legality.
    Error:If you really intend to build a core library -- which is only
    Error:appropriate as part of creating a full virtual machine
    Error:distribution, as opposed to compiling an application -- then use
    Error:the "--core-library" option to suppress this error message.
    Error:If you go ahead and use "--core-library" but are in fact
    Error:building an application, then be forewarned that your application
    Error:will still fail to build or run, at some point. Please be
    Error:prepared for angry customers who find, for example, that your
    Error:application ceases to function once they upgrade their operating
    Error:system. You will be to blame for this problem.
    Error:If you are legitimately using some code that happens to be in a
    Error:core package, then the easiest safe alternative you have is to
    Error:repackage that code. That is, move the classes in question into
    Error:your own package namespace. This means that they will never be in
    Error:conflict with core system classes. JarJar is a tool that may help
    Error:you in this endeavor. If you find that you cannot do this, then
    Error:that is an indication that the path you are on will ultimately
    Error:lead to pain, suffering, grief, and lamentation.
    Error:1 error; aborting

    Information:BUILD FAILED

    Some warnings have been suppressed using 'pickFirst' or 'exclude' methods, but it doesn't seem to go beyond that. The problem disappears only if "compile group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '0.4.0'" gets removed from dependencies(other libraries work fine).

    Thanks.

    Reacted by FrannyZhao
    Reacted by FrannyZhao
  3. mziccard commented on Oct 17, 2016

    @mziccard
    mziccard
    on Oct 17, 2016
    Contributor
    More actions

    Hi @jfarkhat,
    try replacing:

    compile group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '0.4.0'

    with:

    compile ('com.google.cloud:google-cloud-pubsub:0.4.0') {
        exclude group: 'com.google.api-client', module: 'google-api-client-appengine'
    }

    This should exclude the dependency that is causing troubles.

  4. mziccard commented on Oct 18, 2016

    @mziccard
    mziccard
    on Oct 18, 2016
    Contributor
    More actions

    Could you please format your previous posts? Also please don't cut-and-paste these long logs but rather attach a public gist to your post.

    Are you excluding other artifacts in addition to the one I suggested you to exclude?

  5. jfarkhat commented on Oct 18, 2016

    @jfarkhat
    jfarkhat
    on Oct 18, 2016
    More actions

    I am sorry :)))

    Here is the output2 from adding the 3rd line of the code to MainActivity:
    PubSubOptions.Builder optionsBuilder = PubSubOptions.builder();
    optionsBuilder.projectId("project-id");
    PubSub pubsub = optionsBuilder.build().service();

    https://gist.github.com/jfarkhat/3fcdce92eba2a918ef6163c89a3f9913

    I excluded 'group: 'com.google.api-client', module: 'google-api-client-appengine'

  6. mziccard commented on Oct 24, 2016

    @mziccard
    mziccard
    on Oct 24, 2016
    Contributor
    More actions

    @jfarkhat I had a deeper look at this, try adding this dependency:

    compile group: 'com.google.api-client', name: 'google-api-client', version: '1.21.0'
  7. jfarkhat commented on Oct 26, 2016

    @jfarkhat
    jfarkhat
    on Oct 26, 2016
    More actions

    Hi,
    Compile group: 'com.google.api-client', name: 'google-api-client', version: '1.21.0' didn't work(the same errors). But the issue is no longer a problem and I found much simpler solution to it. Thanks )

    Reacted by Ahmad Gerashi and Oleksandr Kachur
  8. mziccard
    closed this as completedon Oct 26, 2016
  9. JustinBeckwith
    assigned
    mziccard
    on Feb 1, 2021
  10. meltsufin
    added 2 commits that reference this issue on Dec 22, 2025

    deps: update dependency org.graalvm.buildtools:junit-platform-native …

    5aef8d6

    chore(main): release 3.14.9 (#1328)

    fc9eff0
  11. chingor13
    added 2 commits that reference this issue on Jan 6, 2026

    deps: update dependency com.google.cloud:google-cloud-logging to v3.1…

    dac9a65

    chore(main): release 0.131.7-alpha (#1322)

    e931893
  12. chingor13
    added a commit that references this issue on Feb 24, 2026

    chore(deps): update dependency com.google.cloud:libraries-bom to v26.…

    0f6e1f6
  13. suztomo
    added 2 commits that reference this issue on Mar 11, 2026

    deps: update dependency org.graalvm.buildtools:junit-platform-native …

    a275ac7

    chore(main): release 3.14.9 (googleapis#1328)

    13b31a5
  14. chingor13
    added a commit that references this issue on Mar 12, 2026

    chore(deps): update dependency com.google.cloud:libraries-bom to v26.…

    7659c54
  15. suztomo
    added a commit that references this issue on Mar 23, 2026

    chore(main): release 2.11.8 (googleapis#1319)

    f0f2c6d
  16. suztomo
    added a commit that references this issue on Mar 30, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-nio to v…

    c120d7e
  17. lqiu96
    added a commit that references this issue on Apr 1, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-nio to v…

    2356321
  18. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    deps: update dependency protobuf to v3.20.2 (#1319)

    f5123fa

    deps: update dependency protobuf to v3.20.2 (#1319)

    1ca3a7f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @mziccard
    mziccard

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.