Android文件合并时,打包出错

xiaoxiao2021-02-28  110

 

android 文件合并打包 Error:Execution failed for task ':app:processEnv_devDebugManifest' '解决方案

Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.0-alpha1) from [com.android.support:appcompat-v7:26.0.0-alpha1] AndroidManifest.xml:27:9-38 is also present at [com.android.support:support-v13:25.3.1] AndroidManifest.xml:27:9-31 value=(25.3.1). Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:41 to override.

重点是:Attribute meta-data#Android.support.VERSION@value value=(25.3.0) 

这里在build合并的时候出现了错误。看有的文章中,差不多也是这样的问题,因为多渠道 引用的versionCode versionName 一类的问题等等。

解决方案:

1.Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:34 to override.按照官方报错添加了,但是并没有解决问题。

2.build.gradle根标签上加上useOldManifestMerger true,试了下也没有解决问题

3.在build.gradle中添加如下代码(任意位置)

configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '25.3.0' } } } }

转载地址:http://blog.csdn.net/piitw/article/details/65935059点击打开链接

转载请注明原文地址: https://www.6miu.com/read-59520.html

最新回复(0)