Ad

Program Type Already Present: Android.support.v4.app.INotificationSideChannel$Stub

- 1 answer

I am getting the following error and I am not able to fix it

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

Here is my gradle file

apply plugin: 'com.android.application'

apply plugin: 'com.google.gms.google-services'
android {
    android.packagingOptions {
        exclude 'META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version'
        exclude 'META-INF/androidx.swiperefreshlayout_swiperefreshlayout.version'
        exclude 'META-INF/androidx.cursoradapter_cursoradapter.version'
        exclude 'META-INF/androidx.drawerlayout_drawerlayout.version'
        exclude 'META-INF/androidx.print_print.version'
        exclude 'META-INF/androidx.versionedparcelable_versionedparcelable.version'
        exclude 'META-INF/androidx.interpolator_interpolator.version'
        exclude 'META-INF/androidx.fragment_fragment.version'
        exclude 'META-INF/androidx.customview_customview.version'
        exclude 'META-INF/androidx.documentfile_documentfile.version'
        exclude 'META-INF/androidx.legacy_legacy-support-core-utils.version'
        exclude 'META-INF/androidx.loader_loader.version'
        exclude 'META-INF/androidx.viewpager_viewpager.version'
        exclude 'META-INF/androidx.asynclayoutinflater_asynclayoutinflater.version'
        exclude 'META-INF/androidx.core_core.version'
        exclude 'META-INF/proguard/androidx-annotations.pro'
        exclude 'META-INF/androidx.slidingpanelayout_slidingpanelayout.version'
        exclude 'META-INF/androidx.coordinatorlayout_coordinatorlayout.version'
        exclude 'META-INF/androidx.legacy_legacy-support-core-ui.version'
    }
    compileSdkVersion 28

    defaultConfig {
        applicationId "com.example.keshav.fbasetest"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }


    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE.md'
        exclude 'META-INF/LICENSE-notice.md'
    }
    dexOptions {
        preDexLibraries = false
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-database:18.0.1'
    implementation 'com.google.firebase:firebase-auth:18.1.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    api 'com.firebaseui:firebase-ui-database:3.2.2'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.google.firebase:firebase-storage:18.1.1'
   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'
    implementation 'com.squareup.picasso:picasso:2.71828'


    }

apply plugin: 'com.google.gms.google-services'

I tried looking at prior solutions and implementing them, but they didn't work. I also tried adding android.useAndroidX=true android.enableJetifier=false to my gradle.properties but the code was still giving this error. Any help would be very appreciated.

Ad

Answer

As per what Gabriele said, migrating to androidx fixed the problems

Ad
source: stackoverflow.com
Ad