Rename package name in React-native

Author - Webner
9.06.2021
|
0 Comments
||

In react-native, To create a new application we use the following command:
react-native init MyApp

This command will create a package name with com.myapp. Sometimes, if your application is created with the wrong package name or bundle id or you want to release your existing application with a different package name then you can change your package name by following the below steps. So, if you want to change your package name then you need to do some changes in the following files:

Android

android/app/src/main/java/MY/APP/NEW_ID/MainActivity.java:
package MY.APP.NEW_ID;
android/app/src/main/java/MY/APP/NEW_ID/MainApplication.java:
package MY.APP.NEW_ID;
android/app/src/main/AndroidManifest.xml:
package="MY.APP.NEW_ID"
android/app/build.gradle:
applicationId "MY.APP.NEW_ID"
android/app/BUCK:
android_build_config( package="MY.APP.NEW_ID" ) android_resource( package="MY.APP.NEW_ID" )
In end clean gradle (in /android folder):
./gradlew clean

iOS

./ios/APPLICATION_NAME/info.plist :
<dict>
...
<key>CFBundleDisplayName</key>
<string>APPLICATION_NAME</string>
<key>CFBundleIdentifier</key>
<string>IOS_BUNDLE_ID</string>
...
</dict>
Clean your project after changes.

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *