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.support.v4.app.INotificationSideChannel$Stub$Proxy, sources=[Unknown source file], tool name=Optional.of(D8)}
This is my gradle script:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId "it.smart.bab3"
minSdkVersion 21
targetSdkVersion 'p'
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.android.support:appcompat-v7:28.0.0-alpha1'
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'
implementation 'com.android.support:design:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
}
I'm new ith this type of errors, and i didn't find anithing with this error. Thanks
com.android.support:design:28.0.0-alpha1
com.google.android.material:material:1.0.0-alpha1.
Use this
and If the problem persists change "import" on class and xml.
like :
or
or
Go to app/build.gradle, in dependencies, remove this line:
I am using android studio 3.3 version. I wasted my one and a half day looking for this solution. I tried all the answer in this post but nothing helped. Then I find the link which helped me to solve the error.
I removed the below dependency I added,
Instead, I used android design support library,
Android Studio v3.2+ resolves this issue. It also adds a "Migrate to AndroidX" item under the Refactor menu. No work-around or rollback required.
Update Android Studio from the beta channel to use 3.2+ or wait until a stable version is released.
EDIT: Android Studio v3.2 is now in the stable channel. It is important you no longer use the support libraries and migrate to AndroidX libraries because support for the old support libraries has ended.
If you are including a library that has a transitive dependency on the Android support library you also have to use the
jetifier
feature that is part of the Android Gradle plugin version 3.2.0-alpha14 or higher. You can determine if you have a library that depends on the support library by running your Gradledependencies
task.From the Android Developer's blog post (https://android-developers.googleblog.com/2018/05/hello-world-androidx.html):
In your
gradle.properties
file make sure that you have:android.enableJetifier=true android.useAndroidX=true
I had this issue with Leak Canary on a small project and it was solved by upgrading the Android Gradle plugin to the appropriate version. https://github.com/square/leakcanary/issues/1103