如果我跑gradle assembleDebug在命令行中,我突然收到以下错误:UNEXPECTED TOP-LEVEL EXCEPTION:com.android.dx.util.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/
AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:592)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:550)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:531)
at com.android.dx.merge.DexMerger.mergeDexBuffers(DexMerger.java:168)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:186)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:300)
at com.android.dx.command.dexer.Main.run(Main.java:232)
at com.android.dx.command.dexer.Main.main(Main.java:174)
at com.android.dx.command.Main.main(Main.java:91)如果我在v4中使用grep,我会在构建文件夹中看到两个文件。Binary file build/pre-dexed/debug/support-v4-19.0.0-2ba5fdd60a6c3836b3104a863fe42897da1fa9d1.jar matchesBinary file build/pre-dexed/debug/
support-v4-r7-227d905d79b23b20866531d4f700446c040a2ccb.jar matches我的Gradle文件只包括这个支持库:compile 'com.android.support:support-v13:19.0.0'对于R7库是如何包含的,我感到很困惑。我跑了gradle clean当我重新运行AssembleDebug时,它总是出现在那里。如果在构建目录中对R7进行grep,我会在文件中看到它:Binary file build/exploded-bundles/ComGoogleAndroidGmsPlayServices4030.aar/classes.jar matches如果我不包括V13,那么其他东西就不会编译。但是V13不包括V4支持库吗?这是Play服务AAR包与V13库之间的不兼容吗?我从gradlejoe.apppot.com抓取了Gradle文件。删除Play服务不会修复它;相同的错误。
3 回答
holdtom
TA贡献1805条经验 获得超10个赞
- 3 回答
- 0 关注
- 783 浏览
添加回答
举报
0/150
提交
取消