3

We have a project that uses different product flavors and product types. When I select a particular flavor, this error is generated:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processSomeFlavorDebugManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

Here is what I have tried:

  • ran the task with -info, -debug, -scan, not very helpful.
  • reviewed the two manifest files to ensure there are no weird characters or spaces in the prolog
  • cleaned project
  • rebuilt project
  • invalidated cache and restart
  • deleted AndroidSDK and Android Studio (also AndroidStudio3.5 directories in ~/Library/...)

Weird thing is, this exact branch builds perfectly fine for others. Did anyone encounter this before?

Takeshi Kaga
  • 48
  • 2
  • 15

2 Answers2

0

This error is thrown from "manifest merger" inside of android gradle plugin.

Try to add this line to the manifest node in your main manifest file.

xmlns:tools="http://schemas.android.com/tools"

Note: You need to use the same android support library version. You need to use support library 28.0.0 version.

I hope it'll help you..!

Viral Patel
  • 1,296
  • 1
  • 11
  • 24
0

check that your manifest have this

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

for more info check this issue on github

also all your xml files should have this line at the beginning

<?xml version="1.0" encoding="UTF-8"?>
Mohammed Alaa
  • 3,140
  • 2
  • 19
  • 21