How to resolve "processDebugMainManifest" Fail When Exporting .AAB file

Godot Version

Godot v4.2.1 stable.official

Question

I’ve almost completed by first game in Godot. I’ve been trying to export an .AAB file so I can test the game on a real Android device, but I keep getting this same error:

Configure project :
The org.gradle.util.WrapUtil type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: Upgrading your build from Gradle 7.x to 8.0
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: Upgrading your build from Gradle 8.x to the latest

Task :clean
Task :assetPacks:installTime:clean
Task :preBuild UP-TO-DATE
Task :preDebugBuild UP-TO-DATE
Task :generateDebugResValues
Task :assetPacks:installTime:generateAssetPackManifest
Task :processDebugAssetPackManifests
Task :mapDebugSourceSetPaths
Task :generateDebugResources
Task :linkDebugManifestForAssetPacks
Task :mergeDebugResources
Task :createDebugCompatibleScreenManifests
Task :extractDeepLinksDebug
Task :processDebugMainManifest FAILED
Task :assetPackDebugPreBundleTask

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:processDebugMainManifest’.

com.android.manifmerger.ManifestMerger2$MergeFailureException: Error parsing /Users/my directory/my company name /GodotGames/Game_Name/android/build/AndroidManifest.xml

I figure the warnings I can ignore (even though I resolved many of them). The “processDebugMainManifest” appears to be the error that is preventing the export. I haven’t been able to find much information as to what this is and how to resolve.

I’ve updated Android Studio to the latest version as well as my Gradle. In Android studio I’ve checked to make sure CMake and NDK are both updated. My Manifest XML file:

<?xml version="1.0" encoding="utf-8"?>

<supports-screens
    android:smallScreens="true"
    android:normalScreens="true"
    android:largeScreens="true"
    android:xlargeScreens="true" />

<uses-feature
    android:glEsVersion="0x00030000"
    android:required="true" />

<application
    android:label="@string/godot_project_name_string"
    android:allowBackup="false"
    android:icon="@mipmap/icon"
    android:appCategory="game"
    android:isGame="true"
    android:hasFragileUserData="false"
    android:requestLegacyExternalStorage="false"
    tools:ignore="GoogleAppIndexingWarning" >

    <!-- Records the version of the Godot editor used for building -->
    <meta-data
        android:name="org.godotengine.editor.version"
        android:value="${godotEditorVersion}" />

    <activity
        android:name=".GodotApp"
        android:label="@string/godot_project_name_string"
        android:theme="@style/GodotAppSplashTheme"
        android:launchMode="singleInstancePerTask"
        android:excludeFromRecents="false"
        android:exported="true"
        android:screenOrientation="landscape"
        android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
        android:resizeableActivity="false"
        tools:ignore="UnusedAttribute" >

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

Any insights as to what could be causing this failure? I don’t have a great deal of experience in Godot, again this is my first game. I’ve been trying to troubleshoot this for 3 days and haven’t had any success. Thanks.

I still don’t have a direct answer for this. However, as I tried to resolve it I opened up my Build files in Android Studio. Once there it showed errors in two AndroidManifest files. For example in 1 file I had to delete the following:

tools:node=“mergeOnlyAttributes”

In the other I had to add the “android:exported" code. I was able to resolve all the errors in the Manifest files. Once I did this the issues above went away (for now) but now I have a new issue(s) that are preventing me from creating my .aab file.

Although I’m still stuck, perhaps this little bit will help someone else if they come across the same error.

Actually I just realized every time I attempt to export to an .aab file the prior changes I made to the build file in Android Studio get overwritten, so I don’t know how to fix those errors.