androidreact-nativeandroid-api-34

React native recommendation: remove package="com...." from the source AndroidManifest.xml


I'm trying to update a react native project from API 33 to 34. After go through many errors, I manage to upgrade API from 31 to 34 according to this answer here https://stackoverflow.com/a/78750253/9751777 But, I having this error for almost every react-natice package in my project

Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported

Recommendation: remove package="com...." from the source AndroidManifest.xml

I followed this answer https://stackoverflow.com/a/75191686/9751777 and manage to fix this error. But every time I run yarn install I have to modify every AndroidManifest file again and it kind of tyring. Do we have no other solution for this type of error? Some of my project packages that i have to modify:

@react-native-async-storage
@react-native-clipboard
@react-native-firebase/app
@react-native-firebase/analytics
@react-native-firebase/crashlytics
@react-native-firebase/database
@react-native-firebase/dynamic-links
@react-native-firebase/firestore
@react-native-firebase/messaging
@react-native-firebase/remote-config
@sayem314
react-native-background-timer
react-native-camera
react-native-device-info
react-native-document-picker    
react-native-fs

.......


Solution

  • Replace the top line manifest in AndroidManifest.xml file to following code.

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.YOUR_PACKAGE_NAME" >