-
Notifications
You must be signed in to change notification settings - Fork 221
Description
Hey team,
I ran into an Android build failure after re-running expo prebuild in a React Native / Expo app that uses both react-native-appsflyer and expo-secure-store.
The problem seems to be in the Expo config plugin here:
expo/withAppsFlyerAndroid.js
It always appends:
android:dataExtractionRulesandroid:fullBackupContent
into tools:replace, even when those keys are already present.
In our app, expo-secure-store is also configuring those same backup attributes, so after expo prebuild the generated AndroidManifest.xml ended up with:
tools:replace=\"android:dataExtractionRules, android:fullBackupContent, android:dataExtractionRules, android:fullBackupContent\"That causes Android manifest merge to fail with:
Execution failed for task ':app:processDebugMainManifest'.
> Multiple entries with same key: android:dataExtractionRules=REPLACE and android:dataExtractionRules=REPLACE
Environment
react-native-appsflyer:6.17.7- Expo SDK:
55 expo-secure-store:55.0.8- React Native:
0.83.2
Repro
- Create an Expo app that uses
react-native-appsflyerandexpo-secure-store - Run
expo prebuild --platform android - Build Android
- Manifest merge fails on
:app:processDebugMainManifest
Expected
The plugin should only add each tools:replace key once.
Actual
The plugin concatenates duplicate values into tools:replace, which breaks manifest merge.
What fixed it locally
I patched the plugin to dedupe the values before joining them:
const existingReplace = application['$']['tools:replace'];
const replaceValues = new Set([
...(existingReplace?.split(',').map((value) => value.trim()).filter(Boolean) ?? []),
'android:dataExtractionRules',
'android:fullBackupContent',
]);
application['$']['tools:replace'] = Array.from(replaceValues).join(', ');After that, expo prebuild generated:
tools:replace=\"android:dataExtractionRules, android:fullBackupContent\"and Android built normally again.
Happy to open a PR if that helps.