Olatunji Oluwayomi
Olatunji Oluwayomi

Reputation: 139

Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed with multiple errors, see logs

My code was compiling before but stopped working and is giving this error

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

log

java.lang.RuntimeException: Activity name cannot be empty. at com.android.tools.idea.model.MergedManifest$ActivityAttributes.(MergedManifest.java:579) at com.android.tools.idea.model.MergedManifest.syncWithReadPermission(MergedManifest.java:418) at com.android.tools.idea.model.MergedManifest.access$000(MergedManifest.java:55) at com.android.tools.idea.model.MergedManifest$1.run(MergedManifest.java:331) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:945) at com.android.tools.idea.model.MergedManifest.sync(MergedManifest.java:328) at com.android.tools.idea.model.MergedManifest.getActivities(MergedManifest.java:464) at com.android.tools.idea.run.activity.DefaultActivityLocator.lambda$computeDefaultActivity$97(DefaultActivityLocator.java:78) at com.intellij.openapi.project.DumbService$1.run(DumbService.java:89)

my manifest

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:header=".MyApplication"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:header=".ui.MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:header="android.intent.action.MAIN" />

            <category android:header="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:header=".ui.ResponseActivity"
        android:label="@string/title_item_detail"
        android:parentActivityName=".ui.MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <meta-data
            android:header="android.support.PARENT_ACTIVITY"
            android:value=".ui.MainActivity" />
    </activity>
</application>

what could be the cause of this?

Upvotes: 1

Views: 1698

Answers (2)

Pavneet_Singh
Pavneet_Singh

Reputation: 37414

Use this for your main activity because name field is required to identify an activity not the header so replace every header with name field

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

instead of this

<intent-filter>
    <action android:header="android.intent.action.MAIN" />

    <category android:header="android.intent.category.LAUNCHER" />
</intent-filter>

So it will

<activity
    android:name=".ui.MainActivity"
    android:label="@string/app_name"
    android:theme="@style/AppTheme.NoActionBar">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

and do the same for other activities too

Upvotes: 1

iamabhaykmr
iamabhaykmr

Reputation: 2021

You have to write android:name=".ui.activityName" in your activity tag of manifest file for each of the activity.

Hope this helps!

Upvotes: 0

Related Questions