۳ محسن موسوی
ارور کلاس تکراری
جامعه جاوا (اندروید) ایجاد شده در ۱۶ مرداد ۱۴۰۱

سلام.من می‌خواستم به حافظه گوشی دسترسی پیدا کنم،اما وقتی در قسمت dependencies لایبرری زیر را implement می‌کنم،خطای کلاس تکراری رو میده

com.karumi:dexter

در قسمت manifest هم permission مربوط به Read external storage رو گذاشتم.

plugins {
    id 'com.android.application'
}
android {
    compileSdk 32
    defaultConfig {
        applicationId "com.example.musicplayer"
        minSdk 21
        targetSdk 32
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary true
        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 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'com.karumi:dexter:5.0.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'com.google.android.material:material:1.6.1'
    implementation "androidx.recyclerview:recyclerview:1.2.1"
    implementation 'com.facebook.fresco:fresco:2.6.0'
    implementation "androidx.viewpager2:viewpager2:1.0.0"
    implementation 'com.facebook.fresco:fresco:2.6.0'
    def lottieVersion = "3.4.0"
    implementation "com.airbnb.android:lottie:$lottieVersion"
}

سلام محسن عزیز

از logcat تون اسکرین بگیرید و برام ارسال کنید .

پوریا شفیعی ۱۷ مرداد ۱۴۰۱، ۰۸:۰۰

Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)


Go to the documentation to learn how to Fix dependency resolution errors.

محسن موسوی ۱۷ مرداد ۱۴۰۱، ۱۲:۵۱

سلام امیدوارم عالی باشید

به gradle.properties بیایید و دو خط کد زیر رو اضافه کنید

android.useAndroidX=true
android.enableJetifier=true

اطلاعات بیشتر در استک : لینک

بهترین پاسخ
پوریا شفیعی ۱۸ مرداد ۱۴۰۱، ۰۵:۴۵