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:dataExtractionRules
android: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-appsflyer and expo-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.
Hey team,
I ran into an Android build failure after re-running
expo prebuildin a React Native / Expo app that uses bothreact-native-appsflyerandexpo-secure-store.The problem seems to be in the Expo config plugin here:
expo/withAppsFlyerAndroid.jsIt always appends:
android:dataExtractionRulesandroid:fullBackupContentinto
tools:replace, even when those keys are already present.In our app,
expo-secure-storeis also configuring those same backup attributes, so afterexpo prebuildthe generatedAndroidManifest.xmlended up with:That causes Android manifest merge to fail with:
Environment
react-native-appsflyer:6.17.755expo-secure-store:55.0.80.83.2Repro
react-native-appsflyerandexpo-secure-storeexpo prebuild --platform android:app:processDebugMainManifestExpected
The plugin should only add each
tools:replacekey 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:
After that,
expo prebuildgenerated:and Android built normally again.
Happy to open a PR if that helps.