Program type already present: android.support.v13.view.DragAndDropPermissionsCompat

前端 未结 5 1193
死守一世寂寞
死守一世寂寞 2020-12-10 09:56

I updated Android studio to 3.1 and this error appears after update:

 Program type already present: android.support.v13.view.DragAndDropPermissionsC         


        
相关标签:
5条回答
  • 2020-12-10 10:35

    This code in app level dependencies worked for me.

    dependencies {
        configurations {
            all*.exclude group: 'com.android.support', module: 'support-v13'
        }
    }
    
    0 讨论(0)
  • 2020-12-10 10:54

    configure it in dependencies in gradle file

        configurations {
        all*.exclude group: 'com.android.support', module: 'support-v13'
        }
    

    eg:-

    dependencies {
    
        configurations {
        all*.exclude group: 'com.android.support', module: 'support-v13'
        }
        //dependencies.....
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:design:27.1.1'
        implementation 'com.android.support:support-v4:27.1.1'
    }
    
    0 讨论(0)
  • 2020-12-10 10:54

    First, you have to check for duplicated dependencies in your module build.gradle. If you run the following line inside your project (in this case app is your module name):

    If you're using linux

    ./gradlew app:dependencies
    

    or use the following if you're using Windows

    gradlew app:dependencies
    

    You can see the dependencies trees and check the duplicated libraries there.

    The following dependencies using old version of support libraries:

    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
    implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
    implementation 'com.appeaser.sublimepickerlibrary:sublimepickerlibrary:2.1.1'
    

    So, you need to exclude the support libraries from them.

    Then you also have duplicated line of dependencies.

    Your build.gradle dependencies should be something like this:

    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    
        implementation 'com.android.support.constraint:constraint-layout:1.0.2'
        // support design implicitly using appcompat-v7 and support-v4
        //implementation 'com.android.support:appcompat-v7:27.1.0'
        implementation 'com.android.support:design:27.1.0'
        implementation 'com.android.support:cardview-v7:27.1.0'
        implementation 'com.android.support:support-annotations:27.1.0'
        implementation 'com.android.support:gridlayout-v7:27.1.0'
        implementation 'com.android.support:recyclerview-v7:27.1.0'
    
    
        implementation 'com.google.firebase:firebase-storage:12.0.0'
        implementation 'com.google.firebase:firebase-auth:12.0.0'
        implementation 'com.google.firebase:firebase-database:12.0.0'
    
        implementation ('com.soundcloud.android:android-crop:1.0.1@aar') {
             exclude group: 'com.android.support'
             exclude module: 'support-annotations'
             exclude module: 'support-v4'
        }
    
        implementation ('com.github.dmytrodanylyk.android-process-button:library:1.0.4') {
             exclude group: 'com.android.support'
             exclude module: 'support-v4'
        }
    
        implementation 'com.appeaser.sublimepickerlibrary:sublimepickerlibrary:2.1.1') {
             exclude group: 'com.android.support'
             exclude module: 'appcompat-v7'
             exclude module: 'support-v4'
             exclude module: 'support-annotations'
             exclude module: 'gridlayout-v7'
        }
    
        implementation 'com.github.yukuku:ambilwarna:2.0.1'
        implementation 'com.wdullaer:materialdatetimepicker:3.5.1'
        implementation 'com.hbb20:ccp:2.1.4'
        implementation 'com.github.clans:fab:1.6.4'
    
        implementation ('com.bignerdranch.android:recyclerview-multiselect:0.2') {
             exclude group: 'com.android.support'
             exclude module: 'appcompat-v7'
             exclude module: 'recyclerview-v7'
        }
    
    
        implementation 'com.squareup.picasso:picasso:2.71828'
        implementation 'com.github.bumptech.glide:glide:4.6.1'
        annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
        implementation 'com.squareup.okhttp3:okhttp:3.10.0'
        implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
        implementation 'de.hdodenhof:circleimageview:2.2.0'
        implementation 'com.github.yalantis:ucrop:2.2.1'
    }
    
    0 讨论(0)
  • 2020-12-10 10:54

    For me:

    Build -> Clean Project

    in Android Studio almost always solved the problem, except once when I had to:

    File -> Invalidate Cache / Restart ...

    0 讨论(0)
  • 2020-12-10 11:01

    This may be happening because you have a duplicate in your build.gradle file. You are using different versions of the same libraries:

     implementation 'com.google.firebase:firebase-auth:12.0.0'
     implementation 'com.google.firebase:firebase-database:12.0.0'
     implementation 'com.google.firebase:firebase-storage:12.0.0'
    

    this may lead be the reason.Add maven { url "https://maven.google.com" } to your root level build.gradle ,Firebase dependencies are now available via maven.google.com

    0 讨论(0)
提交回复
热议问题