AppsFlyerSDK / appsflyer-flutter-plugin

Flutter Plugin for AppsFlyer SDK
MIT License
142 stars 111 forks source link

Android Manifest conflict with Adapty (backup rules) #232

Open guilhermeagostinelli opened 1 year ago

guilhermeagostinelli commented 1 year ago

Hello,

I'm experiencing the following error when trying to execute the app:

/home/guilherme/Desktop/Positiv/mobile_app/android/app/src/debug/AndroidManifest.xml:12:18-70 Error:
    Attribute application@fullBackupContent value=(@xml/adapty_backup_rules) from [com.github.adaptyteam:AdaptySDK-Android:1.11.0] AndroidManifest.xml:12:18-70
    is also present at [com.appsflyer:af-android-sdk:6.8.2] AndroidManifest.xml:15:18-73 value=(@xml/appsflyer_backup_rules).
    Suggestion: add 'tools:replace="android:fullBackupContent"' to <application> element at AndroidManifest.xml:31:5-168:19 to override.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : Attribute application@fullBackupContent value=(@xml/adapty_backup_rules) from [com.github.adaptyteam:AdaptySDK-Android:1.11.0] AndroidManifest.xml:12:18-70
    is also present at [com.appsflyer:af-android-sdk:6.8.2] AndroidManifest.xml:15:18-73 value=(@xml/appsflyer_backup_rules).
    Suggestion: add 'tools:replace="android:fullBackupContent"' to <application> element at AndroidManifest.xml:31:5-168:19 to override.

Related:

By taking a look at https://github.com/AppsFlyerSDK/appsflyer-android-sdk/issues/9#issuecomment-760150089 and https://github.com/adaptyteam/AdaptySDK-Android/blob/master/adapty/src/main/res/xml/adapty_backup_rules.xml I have managed to solve it by:

  1. Creating a backup_rules.xml file in android/app/src/main/res/xml with the following content:
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
    <exclude domain="sharedpref" path="appsflyer-data"/>
    <exclude domain="sharedpref" path="AdaptySDKPrefs.xml"/>
</full-backup-content>
  1. Adding the following two lines to the application tag of my AndroidManifest file:
android:fullBackupContent="@xml/backup_rules"
tools:replace="android:fullBackupContent"

Even though it works, I would like to confirm if this is the right approach and if it won't cause any side effects on the integration with AppsFlyer and on the data being collected.

p.s. where can I find the appsflyer_backup_rules.xml file? On which repository does it reside?

efeurun commented 1 year ago

Hello @guilhermeagostinelli ,

It appears that Appsflyer did not address this topic at all. Have you experienced any issues with this method over time?

joshuadeguzman commented 1 year ago

I also encounter this issue with the latest SDK. Maybe @GM-appsflyer can help? We'd love to know if this approach is the right path to take. Else, this is a critical blocker for the core value prop we want AppsFlyer to handle in the first place.

guilhermeagostinelli commented 1 year ago

Hello @guilhermeagostinelli ,

It appears that Appsflyer did not address this topic at all. Have you experienced any issues with this method over time?

@efelatte No issue that I'm aware of. But it would be nice to have an official confirmation from Appsflyer.

efeurun commented 10 months ago

Hello @guilhermeagostinelli , It appears that Appsflyer did not address this topic at all. Have you experienced any issues with this method over time?

@efelatte No issue that I'm aware of. But it would be nice to have an official confirmation from Appsflyer.

Thanks for the update!

loboda-zutobi commented 5 months ago

It seems to me you also need to specify additional xml (according to the doc https://developer.android.com/guide/topics/data/autobackup#include-exclude-android-12)