error appened when I build pdf project use github implementation
errors below:
Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
settings.gradle.kts below:
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
gradlePluginPortal()//new added
maven { url=uri("https://jitpack.io") }//new added
maven { url=uri("https://repository.liferay.com/nexus/content/repositories/public/") }//new added
}
}
rootProject.name = "DBT2"
include(":app")
below module(app) build.gradle.kts:
plugins {
id("com.android.application")
}
android {
namespace = "aa.app.dbt2"
compileSdk = 34
defaultConfig {
applicationId = "aa.app.dbt2"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
implementation ("com.github.barteksc:android-pdf-viewer:2.8.2")//new added
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
attention: implementation(“androidx.appcompat:appcompat:1.6.1”) ;Dependencies using groupId com.android.support and androidx.* can not be combined but found com.android.support:support-v4:25.3.1 and androidx.appcompat:appcompat:1.6.1 incompatible dependencies