[英]Android studio app does not want compile when I add libs
I made an app with rewarded video from appodeal. 我用来自appodeal的奖励视频制作了一个app。 Everything was ok but something happened and the app stopped compiling with libs from appodeal, with error: Dex merge error. 一切正常,但是发生了一些事情,该应用程序停止使用来自appodeal的lib进行编译,并出现错误:Dex合并错误。 What is going wrong? 怎么了?
logs : 日志:
Configuration 'compile' in project ':app' is deprecated. 项目':app'中的配置'compile'已弃用。 Use 'implementation' instead. 请改用“实现”。 :app:buildInfoDebugLoader :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:checkDebugManifest UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:prepareLintJar UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:createDebugCompatibleScreenManifests UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:splitsDiscoveryTaskDebug UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources :app:javaPreCompileDebug :app:compileDebugJavaWithJavac :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:packageInstantRunResourcesDebug UP-TO-DATE :app:checkManifestChangesDebug :app:transformClassesWithExtractJarsForDebug UP-TO-DATE :app:transformClassesWithInstantRunVerifierForDebug UP-TO-DATE :app:transformClassesWithDependencyC :app:buildInfoDebugLoader:app:preBuild UP-TO-DATE:app:preDebugBuild UP-TO-DATE:app:compileDebugAidl UP-TO-DATE:app:compileDebugRenderscript UP-TO-DATE:app:checkDebugManifest UP-TO-DATE: app:generateDebugBuildConfig UP-TO-DATE:app:prepareLintJar UP-TO-DATE:app:generateDebugResValues UP-TO-DATE:app:generateDebugResources UP-TO-DATE:app:mergeDebugResources UP-TO-DATE:app:create:DebugCompatibleScreenManifests UP- TO-DATE:app:processDebugManifest UP-TO-DATE:app:splitsDiscoveryTaskDebug UP-TO-DATE:app:processDebugResources UP-TO-DATE:app:generateDebugSources:app:javaPreCompileDebug:app:compileDebugJavaWithJavac:app:mergeDebugShaders UP-TO- DATE:app:compileDebugShaders UP-TO-DATE:app:generateDebugAssets UP-TO-DATE:app:packageInstantRunResourcesDebug UP-TO-DATE:app:checkManifestChangesDebug:app:transformClassesWithExtractJarsForDebug UP-TO-DATE :app:transformClassesWithInstantRunVerifierForDebug截止日期:app:transformClassesWithDependencyC heckerForDebug :app:compileDebugNdk NO-SOURCE :app:mergeDebugJniLibFolders UP-TO-DATE :app:transformNativeLibsWithMergeJniLibsForDebug :app:processDebugJavaRes NO-SOURCE :app:transformResourcesWithMergeJavaResForDebug :app:transformNativeLibsAndResourcesWithJavaResourcesVerifierForDebug :app:transformClassesWithInstantRunForDebug :app:transformClassesEnhancedWithInstantReloadDexForDebug UP-TO-DATE :app:incrementalDebugTasks :app:preColdswapDebug :app:fastDeployDebugExtractor UP-TO-DATE :app:generateDebugInstantRunAppInfo UP-TO-DATE :app:transformClassesWithInstantRunSlicerForDebug UP-TO-DATE :app:transformClassesWithDexBuilderForDebug :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED :app:buildInfoGeneratorDebug heckerForDebug:应用:compileDebugNdk NO-SOURCE:应用:mergeDebugJniLibFolders UP-TO-DATE:应用程序:transformNativeLibsWithMergeJniLibsForDebug:应用:processDebugJavaRes NO-SOURCE:应用程序:transformResourcesWithMergeJavaResForDebug:应用程序:transformNativeLibsAndResourcesWithJavaResourcesVerifierForDebug:应用程序:transformClassesWithInstantRunForDebug:应用:transformClassesEnhancedWithInstantReloadDexForDebug UP-TO-DATE: app:incrementalDebugTasks:app:preColdswapDebug:app:fastDeployDebugExtractor UP-TO-DATE:app:generateDebugInstantRunAppInfo UP-TO-DATE:app:transformClassesWithInstantRunSlicerForDebug UP-TO-DATE:app:transformClassesWithDexBuilderForDebug:app:Trans:DiveBuilderForDebug
FAILURE: Build failed with an exception. 失败:构建失败,发生异常。
What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. 出了什么问题:任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败。 java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex
I had the same problem when I updated my google play services. 更新Google Play服务时遇到了同样的问题。
Here is what solved the problem for me : 这是为我解决问题的原因:
If that doesn't work try : 如果这样不起作用,请尝试:
If this didn't work : - Refer to this link it would surely help !! 如果这不起作用:-参考此链接肯定会有所帮助!
I had the same error. 我有同样的错误。 Adding this fixed it 添加此修复程序
android {
defaultConfig {
multiDexEnabled true
}
}
好的,对我来说,最简单的方法就是创建一个新项目,然后从项目中导入所有内容而出错,并且一切都可以正常进行:multiDexEnabled或project clean。
Highly likely you have duplicate libs/classes in the project. 您很有可能在项目中有重复的库/类。 I suggest you check dependencies in build.gradle, check /libs folder. 我建议您检查build.gradle中的依赖项,检查/ libs文件夹。
Check this out. 看一下这个。 It also might help you to identify the problem you have. 它还可以帮助您确定问题所在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.