
使用环境:
Error:java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:com.android.dex.DexException: Multiple dex files define Landroid/support/v4/view/GestureDetectorCompat$GestureDetectorCompatImpl;
解决方法:
这里是多次使用同样的依赖,而且,版本不一致造成的。
统一下版本即可.
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '27.1.1'
}
}
}
}
新旧版本依赖不同是个头疼的问题,希望运气不错的你运气更好!
抱团吹水技术群 -- 拜拜六二妻要领酒

博客指出在Android开发中,多次使用同样依赖但版本不一致会引发问题。解决方法是统一下依赖版本,强调新旧版本依赖不同是个难题,还给出了技术群信息。

被折叠的 条评论
为什么被折叠?



