flutter_background_geolocation icon indicating copy to clipboard operation
flutter_background_geolocation copied to clipboard

Manifest merger failed with multiple errors compiler error when building Flutter app

Open juandelgado opened this issue 2 years ago • 7 comments

Hi there,

I'm having issues trying to update to 4.12.3. When running flutter build appbundle I get a Manifest merger failed with multiple errors (logs below).

The suggestion provided by the compiler does not work, nor any combination that I've tried. My manifest already has tools:replace="android:label" as recommended by the Android installation instructions.

Doing some research, I've found similar issues for example here and here. Unfortunately none of the suggestions work.

I've reviewed the Android installation instructions again but I have not seen a mention for this (although this seem very similar to the issue with android:label).

I'm updating from 4.6.2, which was working ok and did not trigger this merge conflict.

Any help or guidance appreciated, thanks.

Your Environment

  • Plugin version: 4.12.3
  • Platform: Android
  • OS version: N/A
  • Device manufacturer / model: N/A
  • Flutter info (flutter doctor): 3.13.4, macOS 12.6.9, Android SDK 34.0.0
  • Plugin config: N/A

Expected Behavior

App compiles without errors

Actual Behavior

Manifest merger failed with multiple errors.

Steps to Reproduce

Try to compile for Android an app with appsflyer_sdk: 6.12.2 and flutter_background_geolocation: 4.12.3

Context

Debug logs

Attribute application@fullBackupContent value=(@xml/appsflyer_backup_rules) from [com.appsflyer:af-android-sdk:6.10.3] AndroidManifest.xml:21:18-73 is also present at [com.transistorsoft:tslocationmanager:3.4.5] AndroidManifest.xml:41:18-63 value=(@xml/backup_rules).
Suggestion: add 'tools:replace="android:fullBackupContent"' to <application> element at AndroidManifest.xml:10:3-76:17 to override.

juandelgado avatar Sep 24 '23 19:09 juandelgado

I recently added backup_rules.xml to the plug-in in order to prevent the plug-in shared_preferences files from being backed up.

christocracy avatar Sep 24 '23 19:09 christocracy

See here

christocracy avatar Sep 24 '23 19:09 christocracy

Yeah, unfortunately it doesn't seem to resolve the problem

Updating the manifest to:

  <application
        xmlns:tools="http://schemas.android.com/tools"
        tools:replace="label,fullBackupContent">

Throws this error:

tools:replace specified at line:10 for attribute tools:fullBackupContent, but no new value specified

This works, but at the cost of fully disabling the back ups, which is something that I'd prefer not to do:

  <application
        android:allowBackup="false"
        android:fullBackupContent="false"
        tools:replace="label,fullBackupContent">

Thoughts?

juandelgado avatar Sep 24 '23 19:09 juandelgado

Well, who gets to provide this attribute? background_geolocation or this “app_flyer” sdk? Only one gets to declare and yet both are.

christocracy avatar Sep 24 '23 20:09 christocracy

I’m going to remove this attribute from my AndroidManifest because it’s more trouble than it’s worth, but this “app_flyer” sdk is equally culpable.

christocracy avatar Sep 24 '23 20:09 christocracy

Yeah, I hear you.

I've only looked at the issue briefly and I understand why libraries / plugins might want to define what should be in the back up for them, but Android should provide a robust method for the users of those libraries (me in this case) to allow / deny or deal with conflicts like this beyond turning back ups off.

juandelgado avatar Sep 24 '23 20:09 juandelgado

What’s going to have to happen is the app developer will have to manage adding this attribute and 3rd party plug-ins will have to add a “Setup Step” for the developer to paste a particular plug-in’s rules into the app’s backup_rules.xml, which is complicated by Android SDK 34 introducing a completely different xml schema for this.

christocracy avatar Sep 24 '23 20:09 christocracy

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Apr 20 '24 01:04 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 04 '24 01:05 github-actions[bot]