Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

今天导入viewpagerindicator依赖包的时候报了这个错:

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

解决办法:

将依赖包中的

compileSdkVersion 
buildToolsVersion
minSdkVersion
targetSdkVersion

改为和主项目一致,

然后依赖项目中的

compile 'com.android.support:support-v4:18+' 标红

按照提示改为27+

compile 'com.android.support:support-v4:27+'

重新clean然后rebuild  发现FloatMath.ceil方法报错

将FloatMath改为Math  重新clean rebuild

Ok,项目又可以正常运行了

猜你喜欢

转载自blog.csdn.net/ulddfhv/article/details/83038461