任务执行失败:app:processDebugmanifest

问题描述 投票:0回答:5

错误:任务“:app:processDebugManifest”执行失败。

com.android.manifmerger.ManifestMerger2$MergeFailureException: org.xml.sax.SAXParseException;行号:1;列数:1;文件提前结束。

android android-manifest manifest-merging
5个回答
12
投票

尝试将此行添加到您的清单文件中。

<manifest xmlns:tools="http://schemas.android.com/tools"
>


3
投票

我也遇到了这个问题。该错误来自

ManifestMerger
,它让我相信它与我的清单文件有关,这让我走上了错误的道路。如果“资源中存在无效的 XML 文件”,也可能会发生此错误。就我而言,这是一个因合并冲突而遗留下来的布局文件,其中没有任何内容(空布局文件),这反过来又导致了问题。它也可以是任何其他 xml 文件,所以我建议一次打开一个 xml 资源,看看它们是否有任何错误(打开文件时您将收到 lint 错误) 希望这有帮助。


3
投票

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> ........................................... </manifest>



1
投票

<manifest xmlns:android="http://schemas.android.com/apk/res/android"> ... </manifest>

因此,通过在 AndroidManifest.xml 文件中添加以下行解决了我的问题

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> ... </manifest>



0
投票

© www.soinside.com 2019 - 2024. All rights reserved.