When trying to build my android react native app, im getting this error
Execution failed for task ':app:processReleaseMainManifest'.
> Manifest merger failed : Attribute meta-data#org.unimodules.core.AppLoader#react-native-headless@value value=(org.unimodules.adapters.react.apploader.RNHeadlessAppLoader) from [:unimodules-react-native-adapter] AndroidManifest.xml:14:13-88
is also present at [:expo-modules-core] AndroidManifest.xml:14:13-86 value=(expo.modules.adapters.react.apploader.RNHeadlessAppLoader).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:12:9-14:91 to override.
For now I know that in my case it is that I have conflict between two manifest files in node_modules folder:
> cd <YOUR_PROJECT_DIR>/node_modules
> grep -r -i RNHeadlessAppLoader | grep AndroidMan
./expo-modules-core/android/src/main/AndroidManifest.xml:
android:value="expo.modules.adapters.react.apploader.RNHeadlessAppLoader" />
./@unimodules/react-native-adapter/android/src/main/AndroidManifest.xml:
android:value="org.unimodules.adapters.react.apploader.RNHeadlessAppLoader"/>
Solution
xmlns:tools="http://schemas.android.com/tools"
attribute to <manifest>
tag in <YOUR_PROJECT_DIR>/android/app/src/main/AndroidManifest.xml
application
section of your manifest file<meta-data
tools:replace="android:value"
android:name="org.unimodules.core.AppLoader#react-native-headless"
android:value="org.unimodules.adapters.react.apploader.RNHeadlessAppLoader"/>
Updating to last expo SDK seems to be working for me (version 43). Since they replaced the react-native-unimodules
package with an expo
one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With