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

Build Error Android Program type already present: android.support.v4.app.BackStackState$1 #95

Closed
pratamawijaya opened this issue Jun 20, 2018 · 6 comments

Comments

@pratamawijaya
Copy link

pratamawijaya commented Jun 20, 2018

Hello i try to integrate Sonar to my android project, but i got error build

> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
D8: Program type already present: android.support.v4.app.BackStackState$1


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

my build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.2.41'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

and my app/build.gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.pratamawijaya.newsapimvvm"
        minSdkVersion 19
        targetSdkVersion 27
        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.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '27.1.1'
            }
        } else if (requested.group == "com.google.android.gms") {
            details.useVersion '11.8.0'
        } else if (requested.group == "com.google.firebase") {
            details.useVersion '11.8.0'
        }

    }
}

dependencies {

    def room_version = "1.1.0"
    def support_version = "27.1.1"
    def dagger_version = "2.15"

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "com.android.support:appcompat-v7:$support_version"
    implementation "com.android.support:design:$support_version"
    implementation "com.android.support:support-v4:$support_version"
    implementation "com.android.support:cardview-v7:$support_version"

    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'android.arch.lifecycle:extensions:1.1.1'

    implementation "android.arch.persistence.room:runtime:$room_version"
    kapt "android.arch.persistence.room:compiler:$room_version"
    // optional - RxJava support for Room
    implementation "android.arch.persistence.room:rxjava2:$room_version"

//    implementation 'com.nytimes.android:store3:3.0.1'

    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.3'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'

    implementation 'com.xwray:groupie:2.0.3'
    implementation 'com.xwray:groupie-kotlin-android-extensions:2.0.3'

    implementation 'com.github.bumptech.glide:glide:4.7.1'
    kapt 'com.github.bumptech.glide:compiler:4.7.1'

    // logger
    implementation 'com.github.ajalt:timberkt:1.5.0'

    // dagger
    implementation "com.google.dagger:dagger:$dagger_version"
    kapt "com.google.dagger:dagger-compiler:$dagger_version"
    implementation "com.google.dagger:dagger-android:$dagger_version"
    implementation "com.google.dagger:dagger-android-support:$dagger_version"
    kapt "com.google.dagger:dagger-android-processor:$dagger_version"

    debugImplementation 'com.facebook.sonar:sonar:0.+'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

@pratamawijaya pratamawijaya changed the title Build Error Build Error Android Program type already present: android.support.v4.app.BackStackState$1 Jun 20, 2018
@pratamawijaya
Copy link
Author

im trying to exclude support v4, but still error

 debugImplementation ('com.facebook.sonar:sonar:0.0.1'){
        exclude group: 'com.android.support'
        exclude module: 'appcompat-v7'
        exclude module: 'support-v4'
    }

@larslibak
Copy link

I have the same error where Sonar is conflicting with my other dependencies.

@rigor789
Copy link
Contributor

Duplicate of #24

@xiphirx
Copy link
Contributor

xiphirx commented Jun 21, 2018

As mentioned, dupe of #24.

@xiphirx xiphirx closed this as completed Jun 21, 2018
@hiteshcla00
Copy link

i got this error plz help
Program type already present: android.support.v4.app.LoaderManager |
null |
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Users\CLA\IGText\app\build\intermediates\transforms\dexBuilder\debug\1.jar,
com.android.tools.r8.CompilationFailedException: Compilation failed to complete |
com.android.tools.r8.utils.AbortException |

@ManishSharmaApporio
Copy link

Program type already present: android.support.v4.app.FragmentTransitionCompat21$4
Message{kind=ERROR, text=Program type already present: android.support.v4.app.FragmentTransitionCompat21$4, sources=[Unknown source file], tool name=Optional.of(D8)}

facebook-github-bot referenced this issue Apr 8, 2020
…ion � (#988)

Summary:
***
☝️ **Important announcement:** Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! [Find out how to migrate to Snyk and more at greenkeeper.io](https://greenkeeper.io)
***
## The dependency [electron-devtools-installer](https://github.com/MarshallOfSound/electron-devtools-installer) was updated from `2.2.4` to `3.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

 ---

**Publisher:** [marshallofsound](https://www.npmjs.com/~marshallofsound)
**License:** MIT

<details>
<summary>Release Notes for v3.0.0</summary>

<h1><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/compare/v2.2.4...v3.0.0">3.0.0</a> (2020-04-07)</h1>
<h3>Bug Fixes</h3>
<ul>
<li>make extension store directory recursively (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/82479523e251eb24e08d31aa52fbb06b913ac437">8247952</a>)</li>
<li>only allow installs from the main process (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/fc1d8781b6280591b7d6c4913486d9863d2682d2">fc1d878</a>)</li>
<li>support dynamic application path (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/issues/88" data-hovercard-type="pull_request" data-hovercard-url="/MarshallOfSound/electron-devtools-installer/pull/88/hovercard">https://github.com/facebook/flipper/issues/88</a>) (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/e9471f9042adf4070e446c9258c07925bb719f65">e9471f9</a>)</li>
<li>use ES6 standard imports for electron modules.  Closes <a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/issues/116" data-hovercard-type="pull_request" data-hovercard-url="/MarshallOfSound/electron-devtools-installer/pull/116/hovercard">https://github.com/facebook/flipper/issues/116</a> (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/dc0f6e4391cae930107716f610f14a3acb4ef347">dc0f6e4</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li><strong>test:</strong> add mobx to unit tests (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/issues/95" data-hovercard-type="pull_request" data-hovercard-url="/MarshallOfSound/electron-devtools-installer/pull/95/hovercard">https://github.com/facebook/flipper/issues/95</a>) (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/6d4f699877c97ec5a91914180434d8d3175951d8">6d4f699</a>)</li>
<li>Only allow installs from the main process (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/d692149da53ef15d04b8c30e75f630f7f3cf0fd4">d692149</a>)</li>
</ul>
<h3>BREAKING CHANGES</h3>
<ul>
<li>Only allow installs from the main process</li>
</ul>
<p>The remote is being deprecated and as such we should not rely on it for what is a buggy and very small usability tweak.</p>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 22 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/d692149da53ef15d04b8c30e75f630f7f3cf0fd4"><code>d692149</code></a> <code>feat: Only allow installs from the main process</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/0f3ebfc9d3744834bf539d0dd16cb47033204326"><code>0f3ebfc</code></a> <code>chore: update NPM readme badge</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/ba9648c2b91cede408fbf9ece20c3a1ec8d27e4d"><code>ba9648c</code></a> <code>chore: update README badges</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/776912cf7d9ec11981e1d726fa5b4b167506352f"><code>776912c</code></a> <code>BREAKING CHANGE: Only allow installs from the main process</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/ae075d13bc9c92246522e01666c42407b4ec2de0"><code>ae075d1</code></a> <code>build: update CFA plugin</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/0dde83b4a775f1cb44d43770a01d084efd7b124d"><code>0dde83b</code></a> <code>build: use latest v10 node for release CI</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/cc8700c784d06a5184ff95ec969cfb2847c8dda5"><code>cc8700c</code></a> <code>build: update version number for CFA</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/9628782f2f4f540524fb2e626a95e6b113e897e8"><code>9628782</code></a> <code>build: add CFA</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/7d5f15793915f92ac113e79aafb1f6c2d7afe190"><code>7d5f157</code></a> <code>docs: clean up README</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/6d4f699877c97ec5a91914180434d8d3175951d8"><code>6d4f699</code></a> <code>feat(test): add mobx to unit tests (https://github.com/facebook/flipper/issues/95)</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/dc0f6e4391cae930107716f610f14a3acb4ef347"><code>dc0f6e4</code></a> <code>fix: use ES6 standard imports for electron modules.  Closes https://github.com/facebook/flipper/issues/116</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/82479523e251eb24e08d31aa52fbb06b913ac437"><code>8247952</code></a> <code>fix: make extension store directory recursively</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/fc1d8781b6280591b7d6c4913486d9863d2682d2"><code>fc1d878</code></a> <code>fix: only allow installs from the main process</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/a5dfe4c1b1c5441e0c07f7821676f29444c42642"><code>a5dfe4c</code></a> <code>build: rename prepublish to prepare, closes https://github.com/facebook/flipper/issues/120</code></li>
<li><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/commit/a5242e1fd8d7fc90d26d577e2c3b18a9703525ce"><code>a5242e1</code></a> <code>build: update dependencies</code></li>
</ul>
<p>There are 22 commits in total.</p>
<p>See the <a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/compare/0b07982a063079aa12ffc34c12c202e7061c0a62...d692149da53ef15d04b8c30e75f630f7f3cf0fd4">full diff</a></p>
</details>

 ---

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

 ---

Your [Greenkeeper](https://greenkeeper.io) bot 🌴
Pull Request resolved: #988

Test Plan:
{F233368502}

Tested in Flipper

Reviewed By: cekkaewnumchai

Differential Revision: D20889307

Pulled By: passy

fbshipit-source-id: 63ed886cceefe34dc7d4212f25d05c5e13f7dab8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants