Reputation: 80
started a new blank template project and just after adding draglinearlayout dependency i started getting these errors, while before adding this dependency i ran my project and it worked fine. the error is as follows
Execution failed for task ':app:checkDebugDuplicateClasses'. A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-22.1.1-runtime (com.android.support:support-v4:22.1.1) Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-22.1.1-runtime (com.android.support:support-v4:22.1.1) Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-22.1.1-runtime (com.android.support:support-v4:22.1.1)
- Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
this is the error i'm getting
and this is my module grade file
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.ujjwal.drag_and_drop"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.jmedeisis:draglinearlayout:1.1.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Upvotes: 0
Views: 851
Reputation: 1035
Android has a solution to this problem where a new Android project uses AndroidX with some old libraries that use the legacy android support libraries, you are in that case.
The solution is to enable Jetifier in your gradle.properties
, like this:
android.enableJetifier=true
You can find more info in these two posts:
Upvotes: 2