multiple dex files define landroid/support/annotation/AnimRes

前端 未结 18 975
太阳男子
太阳男子 2020-11-28 08:00

The moment I added the android support annotations to my dependencies

compile \'com.android.support:support-annotations:20.0.0\'

I got this erro

相关标签:
18条回答
  • 2020-11-28 08:26

    Updating Android SDK Tools fixed it for me, now it just sees the copy in android-support-v4.jar.

    I had the same problem when using ant, and the annotations library was being included automatically by an outdated sdk.dir/tools/ant/build.xml.

    0 讨论(0)
  • 2020-11-28 08:28

    Clean project works as a temporary fix, but the issue will reappear on next compilation error.

    To fix more reliably, I had to update the dependency to android support-v4 to com.android.support:support-v4:22.2.0.

    0 讨论(0)
  • 2020-11-28 08:30

    Put in your build.gradle the dependency of support-annotations according with your compileSdkVersion. For instance: A project with the compileSdkVersion 25 you can put the following dependence:

    compile 'com.android.support:support-annotations:25.0.1'
    

    This will solve your problem.

    0 讨论(0)
  • 2020-11-28 08:31

    I had the same problem , but i deleted build files from the build folder

    projectname/app/build

    and it removed all the related error. "can't clean the project" and also "dex errow with $anim"

    0 讨论(0)
  • 2020-11-28 08:31

    Put android-support-v4.jar in your libs folder in eclipse. Clean and build the project. It will resolve the issue.

    0 讨论(0)
  • 2020-11-28 08:34

    If this is cordova / ionic project this worked for me

    add these line to build.gradle under platforms/android after line number 22 i.e after apply plugin: 'android'

    configurations {
       all*.exclude group: 'com.android.support', module: 'support-v4'
    }
    
    0 讨论(0)
提交回复
热议问题