当我运行 assembleDebug 时,成功生成了应用程序的调试apk,但尝试 assembleRelease 时,它会导致在 transformDexArchiveWithDexMergerForDebug 任务中失败。
以下是确切错误的摘要:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForRelease'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException:
Program type already present: android.support.annotation.AnimRes
我想知道为什么 assembleDebug 不会出现此错误?
transformDexArchiveWithDexMergerForDebug 和 transformDexArchiveWithDexMergerForRelease 之间到底有什么区别?
P.S。我已经尝试清理并重建项目。