I am trying to run both Adapty and AppsFlyer SDKs in my Managed Workflow, which should theoretically be possible, but I have one issue where both SDKs are trying to write backup rules and this causes builds to fail when merging them.
To resolve it, the solutions involved modifying the Manifest:
I have tried every variation of a plugin to handle this but they have all failed. Right now, I have been trying to set the allowBackup to false, but whenever I run the prebuild command to check if it is being applied, it doesn’t update.
Current plugin:
const { withAndroidManifest } = require('@expo/config-plugins');
const withAllowBackupFalse = (config) => {
return withAndroidManifest(config, (config) => {
console.log('Applying withAllowBackupFalse...');
if (!config.modResults.application || !Array.isArray(config.modResults.application)) {
console.log('Unexpected format in AndroidManifest.xml. Make sure you have an <application> tag.');
return config;
}
for (const application of config.modResults.application) {
if (application && application['$']) {
application['$']['android:allowBackup'] = 'false';
console.log('Set android:allowBackup to false.');
} else {
console.log('Skipped an application element.');
}
}
return config;
});
};
module.exports = withAllowBackupFalse;
It prints the console.log(‘Unexpected format in AndroidManifest.xml. Make sure you have an tag.’);
So it’s like the manifest is not able to be edited when the plugin runs. Any ideas how I can do this?