Using buildToolsVersion 23 fails because Multiple dex files define 'AnimRes'

送分小仙女□ 提交于 2019-11-30 11:32:14

Update: This is fixed in the 23.0.1 version of build tools as the support directory is no longer included in renderscript-v8.jar

The culprit is the version of renderscript-v8.jar that is included in the build tools.

I think this tree output tells everything:

C:.
├───renderscript-v8-22.0.01
│   ├───android
│   │   └───support
│   │       └───v8
│   │           └───renderscript
│   └───META-INF
└───renderscript-v8-23
    ├───android
    │   └───support
    │  ***  ├───annotation
    │       └───v8
    │           └───renderscript
    └───META-INF

I've tagged the directories with the version of the build tools that included them. Notice the annotations subdirectory in renderscript-v8-23 that doesn't exist in renderscript-v8-22.0.01.

There is already a report of the issue here: https://code.google.com/p/android/issues/detail?id=179493 And a duplicate here: https://code.google.com/p/android/issues/detail?id=181697

Tim Malseed

I can't say I understand this solution - or that it's necessarily a good fix, but it got my app compiling again:

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

Also, see: Getting Multiple dex error when using render script support lib

Credit to Luboš Staráček for this solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!