0

When I am attempting to run my app in Android studio I am getting the following error:

Duplicate class android.support.v4.app.ActionBarDrawerToggle found in modules classes.jar

Along with other duplicate class complaints.

I've tried modifying the build.gradle file, but I have little luck fixing the issue. Not sure how I can prevent this error from happening.

Here is my build.gradle file.

 android {
        compileSdkVersion 28
       //buildToolsVersion '26.0.2'
       //buildToolsVersion '28.0.2'
       defaultConfig {
           applicationId "com.app"
           minSdkVersion 16
           targetSdkVersion 28
           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'])
        androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
    })

        implementation 'com.android.support:appcompat-v7:28.0.0'
        implementation 'com.android.support:design:28.0.0'

        testImplementation 'junit:junit:4.12'

        // RecyclerView
        implementation 'com.android.support:recyclerview-v7:28.0.0'

        // CardView
        implementation 'com.android.support:cardview-v7:28.0.0'

        // Glide
        implementation 'com.github.bumptech.glide:glide:3.7.0'
        implementation 'com.google.android.gms:play-services-appindexing:8.4.0'

        // floating buttons
        implementation 'com.github.clans:fab:1.6.4'

        // Time Square (Calendar)
        implementation 'com.squareup:android-times-square:1.7.0@aar'
}
Jitesh Prajapati
  • 2,533
  • 4
  • 29
  • 51
  • Check this answer:https://stackoverflow.com/questions/56029393/why-im-getting-duplicate-class-when-running-my-android-project – Kabir Aug 21 '19 at 02:22
  • I tried to add the following to the build.gradle and I get format errors: `configurations { all*.exclude group:'android.support.v4.app' module: ‘classes.jar’ all*.exclude group:'android.support.v4.accessibilityservice' module: ‘classes.jar’ }` there is a syntax error in android studio for the `module:` and the apostrophe around the `classes.jar`? – Jamie Smith Aug 21 '19 at 14:39
  • @JamieSmith classes.jar is the module in that question not related to your question. – A Farmanbar Nov 20 '19 at 01:55

0 Answers0