Google material design library error Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
I've been struggling all day with this issue too. Finally I managed to compile and run the project successfully.
First of all, get rid of this:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
Add the following in your gradle.properties file:
android.useAndroidX = true
android.enableJetifier = false
And finally, sync the project and then compile.
If it doesn't work, clean the project and then rebuild.
PS: I can't get targetSdkVersion 'p' to work. My build.gradle file end up as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId "com.github.alvarosct02.demo"
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.material:material:1.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.1.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'
}
Hope it works for you too.
Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
This happened to me when I tried to migrate to Android X.The reason behind is that not all libraries have been migrated to Android X.
- You may manually remove dependencies. : Try to see all dependencies and find out the conflicting one. You may use Gradle View plugin for Android Studio or use class navigation from menu. (In android Studio: Navigation -> class; Now a search box appears and tick 'include non project items'; paste the whole class name creating error and search now; Find out the class having this dependency and remove manually!). Please check if you have any import statements left in files which uses the non AndoirdX dependencies still. If yes, please remove them too.
or
- In Android studio, Refractor -> Migrate to AndroidX.
or alternatively(manual way)
- add following to gradle.properties .
android.useAndroidX=true
android.enableJetifier=true
This makes Android Studio to migrate all dependencies. For more info please check here
Related Topics
Best Way to Compare Dates in Android
Java - Process.Destroy() Source Code for Linux
Exception in Thread "Main" Java.Lang.Noclassdeffounderror: Org/Openqa/Selenium/Webdriver
Java.Io.Console Support in Eclipse Ide
How to Terminate Scanner When Input Is Complete
How to Return 2 Values from a Java Method
How to Count the Number of Matches for a Regex
Good Hash Function for Strings
What Is the Default Access Specifier in Java
Why Double Width = 50/110000; the Output Is 0.000000000000000
Setting Custom Actionbar Title from Fragment
Inputstream.Available() Is 0 Always
Getting Fonts, Sizes, Bold,...Etc
How to Call a Stored Procedure from Java and JPA
How to Add an Actionlistener Onto a Jbutton in Java
How to Run Certain Task Every Day at a Particular Time Using Scheduledexecutorservice