android.support.v4.app.INotificationSideChannel$Stub$Proxy

8.3k views Asked by At

com.hendraanggrian.appcompat:socialview:0.1 library work with androidx. when i add this library to my project I got support.v4 error :

Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy

for solving this issue I add below code to gradle.properties

android.useAndroidX = true
android.enableJetifier = false
android.enableD8 = false

but not affect. another solution i tried below code

configurations {
        all*.exclude group: 'com.android.support', module: 'support-v4'
//        all*.exclude group: 'com.android.support', module: 'appcompat-v7'
//        all*.exclude group: 'com.android.support', module: 'design'
    }

that not affect.

also i tried to get dependencies tree to find duplicates with this command

./gradlew dependencies -q 

but got error. another thing that may help is that i use kotlin in some cases in this project

the problem is that when i build project and test with adb project built successfully but when i try to build apk in android studio this error appeares

2

There are 2 answers

0
nariman amani On BEST ANSWER

finally i migrate all project to androidx and issue resolved.

0
Hyunchul Eddy Kim On

I had the same issue. After I changed the version of Android Gradle Plugin to 3.2.0-rc03. (After you change, you should change to gradle version to 4.6)

https://android-developers.googleblog.com/2018/05/hello-world-androidx.html In this article, they said they rewrote bytecode and resources of JAR and AAR dependencies to reference the new androidx-package classes and artifacts at 3.2.0-alpha14. Prev version of Android Gradle Plugin might have android.support.v4.app.INotificationSideChannel$Stub$Proxy. So if we want to use androidx, we should change the version of Android Gradle Plugin after 3.2.0-alpha14.