• Register
0 votes
1.9k views

Problem :

I am learning Android Studio. I am trying to add implemntation 'com.google.android.material:material:1.0.0-alpha1' but if I try to build the project then my Android Studio gives below error:

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

How can I fix the above error?

8 4 2
2,300 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have also wasted a lot of time on above error. But now I have the solution on it so sharing with you.

Just try to follow below procedure and your error will be fixed.

To begin with you need to update your Android Studio to a latest version.

After that you must update your compileSdkVersion and targetSdkVersion to the 28 as shown below

android {
compileSdkVersion 28
 defaultConfig {
        applicationId "com.your.appid"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 50
        versionName "1.50"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        setProperty("archivesBaseName", "your-app-$versionName")
        resConfigs "en"
     }
}

Now please go to the project structure and change the gradle version to 4.10.

Please add below listed dependency:

implementation 'com.google.android.material:material:1.0.0'

Also you need to remove all the support library dependencies which are shown below:

implementation "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:multidex:1.0.3'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
androidTestImplementation('com.android.support.test.espresso:espresso- 
   core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs', module: 'jsr305'
})

After that just paste the below code into your gradle.properties file:

android.useAndroidX = true
android.enableJetifier = true
In your project level build.gradle file:
dependencies {
    classpath 'com.android.tools.build:gradle:3.2.0'
    classpath 'com.google.gms:google-services:4.1.0'
};

 

5 2 1
4,980 points

Related questions

0 votes
1 answer 3 views
3 views
Problem: Whenever i add implemntation 'com.google.android.material:material:1.0.0-alpha1' when i try to build my project Android Studio says: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy Message{kind=ERROR, text=Program type already present: android. ... 0.0-alpha1' } I'm new ith this type of errors, and i didn't find anithing with this error. Thanks
asked Apr 25 sumaiya simi 43.9k points
0 votes
1 answer 10 views
10 views
Problem: I have upgraded my Android Studio and I found many problems in the latest version. Although many similar questions exist, I checked the answers to all and none of them worked for me! Here is the error I'm facing while compiling the code: Program type already present: ... Optional.of(D8)} Can you tell me if there is anything else to add to understand what I'm doing or where I'm wrong?
asked May 1 anika11 32.2k points
0 votes
1 answer 13 views
13 views
Problem: error: program type already present: android.support.v4.app.fragmenttransitioncompat21$1
asked Feb 20 Lucky Guy 1.5k points
0 votes
1 answer 2 views
2 views
Problem: I have upgraded my Android Studio and I found many problems in the latest version. Although many similar questions exist, I checked the answers to all and none of them worked for me! Here is the error I'm facing while compiling the code: ... ERROR, text=Program type already present: android.support.v4.app.BackStackRecord$Op, sources=[Unknown source file], tool name=Optional.of(D8)}.
asked May 2 Humaira ahmed 50.7k points
0 votes
1 answer 10 views
10 views
Problem: I'm refactoring an app to use androidx. I have struggled to get rid of all the libraries that do not support it. I thought I had removed all the libraries that use the support libraries but it ... versionPatch = 0 compileSdkVersion 'android-P' compileOptions { targetCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8 defaultConfig { applicationId "org.appid"
asked May 1 ochena 23.3k points
1 vote
1 answer 15 views
15 views
Problem: I’m new in Android app development. I have been having an issue with duplications within my project this is the most common one it all seems to be related to the "android.support" bits Error: Program type already present: android.support.v4.app.FragmentTransitionCompat21$1 How can i fix this issue. Thanks.
asked Mar 12 Sabbir Hossain 14.6k points
1 vote
1 answer 13 views
13 views
Problem : How to resolve this error > D8: Program type already present: android.support.v13.view.DragAndDropPermissionsCompat
asked Apr 30 Abik Dey 4k points
0 votes
1 answer 3 views
3 views
Problem: I am getting the following error while building the project. haven't used CoordinatorLayout in this project. just added as a dependency in build.gradle : I am using Android Studio 3.2 Canary 4. LogCat AGPBI: {"kind":" ... /build/intermediates/transforms/dexBuilder/debug/294.jar Program type already present: android.support.design.widget.CoordinatorLayout$Behavior How can I solve this?
asked Apr 25 munim01 21k points
0 votes
1 answer 19 views
19 views
Problem: error: program type already present: android.support.design.widget.coordinatorlayout$behavior
asked Feb 19 Lucky Guy 1.5k points
0 votes
2 answers 72 views
72 views
Problem : I am facing the following issue while building my project. I haven't used any CoordinatorLayout in my project. I have just added it as a dependency in my build.gradle : I am currently using Android Studio 3.2 Canary 4. ... ..... /windows/Other/app/build/intermediates/transforms/dexBuilder/debug/304.jar Program type already present: android.support.design.widget.CoordinatorLayout$Behavior
asked Dec 5, 2019 alecxe 7.5k points