Change package name for Android in React Native
Asked Answered
S

30

287

I used react-native init MyApp to initialise a new React Native app. This created among others an Android project with the package com.myapp.

What's the best way to change this package name, for example to: com.mycompany.myapp?

I tried changing it in AndroidManifest.xml but it created other errors, so I'm assuming it's not the way.

Any idea?

Shorts answered 23/5, 2016 at 11:34 Comment(5)
Left click on package name and go for Refactor--> Rename option to rename package name.Narrow
What works best for me now is just find & replaceShorts
You can also try this saumya.github.io/ray/articles/72Underclay
for me search & replace workedWillemstad
The pragmatic approach: 1- npx react-native init MycompanyMyapp, 2- Change only the applicationId "com.mycompany.myapp" in android/app/build.gradle. "However, the application ID and package name are independent of each other" – developer.android.com/studio/build/application-idPansir
M
648

I've renamed the project' subfolder from: "android/app/src/main/java/MY/APP/OLD_ID/" to: "android/app/src/main/java/MY/APP/NEW_ID/"

Then manually switched the old and new package ids:

In: android/app/src/main/java/MY/APP/NEW_ID/MainActivity.java:

package MY.APP.NEW_ID;

In android/app/src/main/java/MY/APP/NEW_ID/MainApplication.java:

package MY.APP.NEW_ID;

In android/app/src/main/AndroidManifest.xml:

package="MY.APP.NEW_ID"

And in android/app/build.gradle:

applicationId "MY.APP.NEW_ID"

In android/app/BUCK:

android_build_config(
  package="MY.APP.NEW_ID"
)
android_resource(
  package="MY.APP.NEW_ID"
)

Gradle' cleaning in the end (in /android folder):

./gradlew clean
Myca answered 23/5, 2016 at 11:40 Comment(20)
I also need to edit file BUCK to replace old package value with the new one. BTW, the 2 files MainAcitivity.java and MainApplication.java should be relocated to the new physical path.Phiona
I also renamed the directory android/app/src/main/java/com/old_app_name/ to ...com/new_app_name/ and it seems to work.Monica
I had error "Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE" until I manually forced cleaning of the android device simulator: adb uninstall my.package.name ... So directions are fine, but android simulator can "hold on" to old info in a bad way that makes it look like directions don't work. (And simply uninstalling the app did NOT fix this!)Foreshore
I was reading about this and I tried this library: npmjs.com/package/react-native-rename seems to be working pretty fine for this, it does not only rename the app but it also can change the bundle identifierAnubis
don't forget to change applicationId in app/build.gradle tooMaori
What about android/settings.gradle file? (specifically rootProject.name = 'OLD_ID')Whorton
Uh, oh and android/app/src/main/res/values/strings.xml and app_name inside that file.Whorton
bash: ./gradlew: No such file or directory i am getting this.Bile
do it in android/ folder @BileMyca
@Cherniv how did you get to have "MY.APP.OLD_ID" package name. I mean react native creates "MY.APP"? I'm trying to achieve 3 level package nameBilbe
i was need to delete the old path and conetent then it workedChaffee
these instructions worked as a first step. However I also had to sync with gradle in Android Studio project again, or I would get errors at build time.Bini
don't forget the Proguard rules, if anyPopinjay
The answer was great and helpful. It would be nice bonus to have also info about iOS package name changes.Huntingdon
I also had to rename the import file of BasePackageList in MainApplication and in android/app/src/main/generated/BasePackageList.javaAnalogy
For RN 0.60+, there's another LoC that has to be changed in MainApplication#initializeFlipper: Class<?> aClass = Class.forName("MY.APP.NEW_ID");Carafe
it's helpful to do a project wide search () for com.appName and replace them all with com.companyName.appName. And if you do it with VScode, remember to disable "Use Exclude Settings and Ignore Files".Iridis
if you are using firebase then you also need to replace old package value in two instances of package_name in google-services.jsonSubatomic
and change app.json file tooForgery
tks, 3 steps and it works: (1) find and change package name, (2) change package dir paths, (3) gradlew cleanBraise
I
106

I use the react-native-rename* npm package. Install it via

npm install react-native-rename -g

Then, from the root of your React Native project, execute the following:

react-native-rename "MyApp" -b com.mycompany.myapp
Ifill answered 17/9, 2017 at 10:28 Comment(11)
thats simple and tricky one, I just need to update the MainApplication.java manually.Almagest
Thanks, broke the projectRecept
@AkashRajput did you fix your issue? please let us know if you found any solutionEtienne
@SaleemKhan Had to create the project again. This time with react-native init.. Just copy the files.Recept
thanks @AkashRajput :) but I was referring to the renaming issue. Did you figure out a way to do it?Etienne
@SaleemKhan in iOS just change the bundle ID & in Android Studio do manual refactoring reference: saumya.github.io/ray/articles/72Recept
It broke my project, and had to create a new project :(Maori
@AchaBill This answer is from 2017 things have changed since... be careful out there.Rusticus
Worked like a charm in "react-native": "0.63.4", Thanks for saving my time. :)Iodize
This worked for me. Make sure you create a git branch just in case: git checkout -b newBranchNameOlette
for me this worked for android but crashed for ios, i just undid all ios changes updated in xcode manuallyCatlin
Z
45

To change the package name from com.myapp to: com.mycompany.myapp (for example),

  1. For iOS app of the react app, use xcode - under general.
  2. For the android app, open the build.gradle at module level. The one in the android/app folder. You will find
// ...
defaultConfig {
     applicationId com.myapp
     // ...
}
// ...

Change the com.myapp to whatever you need.

Hope this helps.

Zamora answered 2/7, 2018 at 10:17 Comment(5)
This is the easiest way to change your package name. Tho, not changing your local package name, this will change your next build package. Thanks! After doing this, do ./gradlew clean and then ./gradlew app:assembleRelease.Snag
"However, the applicationId and the local package name are independent of each other", "applicationId uniquely identifies your app on the device and in Google Play Store" – developer.android.com/studio/build/application-idPansir
not work for me No matching client found for package name 'xxxxx'Zimbabwe
For changing the package name of android, I ran into this error and fixed #35132269Jackfish
Finally, this is the only way that worked for me. I needed to change just the .aab package id for play store upload, and this accomplished just that.Kemerovo
S
20

you can simply use react-native-rename npm package.

Install using

npm install react-native-rename -g

Then from the root of your React Native project execute the following

react-native-rename "MyApp" -b com.mycompany.myapp

react-native-rename on npm

but notice that, this lib remove your MainActivity.java and MainApplication.java. before changing your package name, give a backup from this two file and, after changing package name just put it back to their place. this solution work for me

more info: react-native-rename

Shawannashawl answered 30/1, 2019 at 8:55 Comment(2)
No effect if you don't change app name "Please try a different name."Vaios
actually, I try different name for my project. but when I change my project name react-native-rename removes that two files from my project.Shawannashawl
L
11

REACT 0.64 | 2021 NO EXPO

Let original App name be: com.myApp Let New App Name: 'com.newname.myApp`

  1. android\app\src\main\AndroidManifest.xml

Rename xml attribute: `package="com.newname.myApp"


  1. android\app\src\main\java\com\[yourAppName]\MainActivity.java

Rename first line from package com.myApp; To package com.newname.myApp;


  1. android\app\src\main\java\com\[yourAppName]\MainApplication.java

Rename first line To package com.newname.myApp;

In class private static void initializeFlipper reneme this line:

Class<?> aClass = Class.forName("com.myApp.ReactNativeFlipper");

To

Class<?> aClass = Class.forName("com.newname.myApp.ReactNativeFlipper");


  1. android\app\build.gradle

On the defaultConfig rename applicationId

to "com.newname.myApp"


  1. Run on command line:

      $ npx react-native start
      $ npx react-native run-android
    
Laurasia answered 4/8, 2021 at 9:21 Comment(1)
Check google-services.json if you have one too.Escutcheon
C
10

Goto Android studio

Right click your package (most probably com)-> Refractor -> Rename -> Enter new package name in the dialog -> Do Refractor

It will rename your package name everywhere.

Cosetta answered 27/3, 2018 at 12:52 Comment(2)
It will not affect in the whole project structure i guess.Concomitance
How can do with React-Native JS project ?Increscent
M
10

In VS Code, press Ctrl + Shift + F and enter your old package name in 'Find' and enter your new package in 'Replace'. Then press 'Replace all occurrences'.

Definitely not the pragmatic way. But, it's done the trick for me.

Maddock answered 24/5, 2019 at 12:9 Comment(4)
This worked fine on a Mac.. In my case, I have a RN project on iOS and Android. I just needed to make sure that I didn't make any changes to iOS proj.Andros
Might also want to search/replace com/you/package mappings along with com.your.package.Ptolemy
This isn't enough (well, maybe it is, if you're using Expo). You also have to rename the folders under android/app/src/main/java and android/app/src/debug/java. The folder structure is e.g. com/acme/awesomeapp, and reflects the package name structure.Mellins
@ChristianDavén +1 I'd just like to add that I had an unpublished app with the package name, say, com.myApp & then I replaced all instances of it with com.myNewApp and nothing broke. It would be prudent to rename the folders as you suggest, but that's not a hard requirement. Should you rename? Yes. Do you have to? No.Verminous
M
9

If you are using Android Studio-

changing com.myapp to com.mycompany.myapp

  1. create a new package hierarchy com.mycompany.myapp under android/app/src/main/java

  2. Copy all classes from com.myapp to com.mycompany.myapp using Android studio GUI

  3. Android studio will take care of putting suitable package name for all copied classes. This is useful if you have some custom modules and don't want to manually replace in all the .java files.

  4. Update android/app/src/main/AndroidManifest.xml and android/app/build.gradle (replace com.myapp to com.mycompany.myapp

  5. Sync the project (gradle build)

Morell answered 15/1, 2018 at 6:28 Comment(0)
C
9

The init script generates a unique identifier for Android based on the name you gave it (e.g. com.acmeapp for AcmeApp).

You can see what name was generated by looking for the applicationId key in android/app/build.gradle.

If you need to change that unique identifier, do it now as described below:

In the /android folder, replace all occurrences of com.acmeapp by com.acme.app

Then change the directory structure with the following commands:

mkdir android/app/src/main/java/com/acme

mv android/app/src/main/java/com/acmeapp android/app/src/main/java/com/acme/app

You need a folder level for each dot in the app identifier.

Source: https://blog.elao.com/en/dev/from-react-native-init-to-app-stores-real-quick/

Carious answered 18/8, 2018 at 17:18 Comment(0)
F
8

If you are using VSCode and Windows.

1.Press Control + Shift + F.

2.Find Your Package Name and Replace All with your new Package Name.

  1. type "cd android"

  2. type "./gradlew clean"

Felspar answered 10/11, 2020 at 11:49 Comment(1)
Seems like a bad approach but worked flawlessly.Katowice
B
6

I have a solution based on @Cherniv's answer (works on macOS for me). Two differences: I have a Main2Activity.java in the java folder that I do the same thing to, and I don't bother calling ./gradlew clean since it seems like the react-native packager does that automatically anyways.

Anyways, my solution does what Cherniv's does, except I made a bash shell script for it since I'm building multiple apps using one set of code and want to be able to easily change the package name whenever I run my npm scripts.

Here is the bash script I used. You'll need to modify the packageName you want to use, and add anything else you want to it... but here are the basics. You can create a .sh file, give permission, and then run it from the same folder you run react-native from:

rm -rf ./android/app/src/main/java


mkdir -p ./android/app/src/main/java/com/MyWebsite/MyAppName
    packageName="com.MyWebsite.MyAppName"
    sed -i '' -e "s/.*package.*/package "$packageName";/" ./android/app/src/main/javaFiles/Main2Activity.java
    sed -i '' -e "s/.*package.*/package "$packageName";/" ./android/app/src/main/javaFiles/MainActivity.java
    sed -i '' -e "s/.*package.*/package "$packageName";/" ./android/app/src/main/javaFiles/MainApplication.java
    sed -i '' -e "s/.*package=\".*/    package=\""$packageName"\"/" ./android/app/src/main/AndroidManifest.xml
    sed -i '' -e "s/.*package = '.*/  package = '"$packageName"',/" ./android/app/BUCK
    sed -i '' -e "s/.*applicationId.*/    applicationId \""$packageName"\"/" ./android/app/build.gradle

    cp -R ./android/app/src/main/javaFiles/ ./android/app/src/main/java/com/MyWebsite/MyAppName

DISCLAIMER: You'll need to edit MainApplication.java's comment near the bottom of the java file first. It has the word 'package' in the comment. Because of how the script works, it takes any line with the word 'package' in it and replaces it. Because of this, this script may not be future proofed as there might be that same word used somewhere else.

Second Disclaimer: the first 3 sed commands edit the java files from a directory called javaFiles. I created this directory myself since I want to have one set of java files that are copied from there (as I might add new packages to it in the future). You will probably want to do the same thing. So copy all the files from the java folder (go through its subfolders to find the actual java files) and put them in a new folder called javaFiles.

Third Disclaimer: You'll need to edit the packageName variable to be in line with the paths at the top of the script and bottom (com.MyWebsite.MyAppName to com/MyWebsite/MyAppName)

Barbary answered 3/6, 2017 at 18:59 Comment(0)
P
6

To change the Package name you have to edit four files in your project :

 1. android/app/src/main/java/com/reactNativeSampleApp/MainActivity.java
 2. android/app/src/main/java/com/reactNativeSampleApp/MainApplication.java
 3. android/app/src/main/AndroidManifest.xml
 4. android/app/build.gradle

The first 2 files have the package name as something like below.

 package com.WHATEVER_YOUR_PACKAGE_NAME_IS;

Change it to your desired package name.

 package com.YOUR_DESIRED_PACKAGE_NAME;

You have to also edit the package name in 2 other files.

  android/app/build.gradle

  android/app/src/main/AndroidManifest.xml

Note if you have a google-services.json file in your project then you have to also change your package name in that file.

After this, you have to ./gradlew clean your project.

Ptah answered 2/7, 2021 at 12:51 Comment(0)
B
5

There are a lot of bad answers here

if you want to change the package name, go to your build.gradle in app

 defaultConfig {
        applicationId "your.new.package.name" //change this line

then when running the app from the command line, pass in the new package name as an arg

react-native run-android --appId your.new.package.name

There's no need to rename your whole project

Blanchblancha answered 18/1, 2023 at 22:22 Comment(2)
What about ios? @BlanchblanchaTucana
for iOS just change bundle identifier in xcodeBlanchblancha
P
5

In case, you are fine with creating new react-native project, and migrate your code there, you can simply do it using:

npx react-native init --package-name com.yourcompany.yourapp yourappname

, which will also setup the required and respective nested folder structure based on your custom package name. Then you can proceed with migrating your code there. It has worked in my case.

Poirier answered 2/11, 2023 at 5:26 Comment(0)
A
3

Go to Android Studio, open app, right click on java and choose New and then Package.

Give the name you want (e.g. com.something).

Move the files from the other package (you want to rename) to the new Package. Delete the old package.

Go to your project in your editor and use the shortcut for searching in all the files (on mac is shift cmd F). Type in the name of your old package. Change all the references to the new package name.

Go to Android Studio, Build, Clean Project, Rebuild Project.

Done!

Happy coding :)

Aut answered 28/5, 2019 at 20:40 Comment(0)
R
3

After running this:

react-native-rename "MyApp" -b com.mycompany.myapp

Make sure to also goto Build.gradle under android/app/... and rename the application Id as shown below:

defaultConfig {
        applicationId:com.appname.xxx
........
}
Redemption answered 25/6, 2020 at 20:9 Comment(0)
D
3

I will provide you step by step procedure.

First of all, we need to understand why we need to rename a package? Mostly for uniquely identifying App right? So React Native is a cross-platform to develop an app that runs on both iOS and Android. So What I recommended is to need the same identifier in both the platforms. In case Android Package Name is a unique identifier of your App and for iOS its bundle ID.

Steps:

  1. Firstly close all editors/studio eg: xcode android studio vscode and then Install package "react-native-rename" in the terminal by running the command (Keep your project folder copy in another folder for backup if you don't feel this safe):

npm install react-native-rename -g

  1. After sucessfully installing package open your project folder in the terminal and hit the below command where "Your app name Within double quotes" is app name and <Your Package Name without double/single quotes> is replaced with package/bundle name/id:

react-native-rename "< Your app name Within double quotes >" -b <Your Package Name without double/single quotes>

Example: react-native-rename "Aptitude Test App" -b com.vaibhavmojidra.aptitudetestapp

Note Make sure the package/bundle name/id is all in small case

  1. This is not yet done yet now every file will change where the it had bundle/package names except one in ios project which we manually need to do for that open the xcode>open a project or file> choose file from projectfolder/ios/projectname.xcodeproj and click open

  2. Click on your projectname.xcodeproj that is first file in the project navigator then in field of Bundle identifier enter the package name/Bundle ID as below:

enter image description here

  1. After that run in the terminal

cd ios

  1. Then run

pod install

  1. Then run

cd ..

  1. Now you are done for all the changes for ios just last step is to open Android Studio>Open an Existing Project> select projectfolder/android folder > Click on open

  2. Let it load and complete all the process and then in the Build Menu click "Clean Project" and the in File Menu > Close Project

  3. Close All editors and Now You can try the commands to run project on ios and android it will run with renamed packaged just while start server add extra flag --reset-cache:

npm start --reset-cache

Enjoy it will work now

Drier answered 10/12, 2021 at 19:40 Comment(1)
this is just the best answer for this issue.Barbital
P
2

I fixed this by manually updating package name in following places

1) app.json               |  ./
2) index.js               |  ./
3) package.json           |  ./
4) settings.gradle        |  ./android/
5) BUCK                   |  ./android/app/
6) build.gradle           |  ./android/app/
7) AndroidManifest.xml    |  ./android/app/src/main/
8) MainActivity.java      |  ./android/app/src/main/java/**
9) MainApplication.java   |  ./android/app/src/main/java/**
10)strings.xml            |  ./android/app/src/main/res/values
11)ReactNativeFlipper.java|  ./android/app/src/debug/java/com/<package-name>/
Parenthood answered 28/12, 2021 at 3:41 Comment(0)
C
2

I use the react-native-rename* npm package. Install it via

npm install react-native-rename -g

Then, from the root of your React Native project, execute the following:

react-native-rename "MyApp" -b com.mycompany.myapp
Countertenor answered 4/11, 2022 at 6:5 Comment(0)
H
1

For those coming from RN 0.72+.

Do what the top answers tells you to do and...

Please double check this android/app/build.gradle

// namespace needs to be the same as the top package import in MainApplication.java
    namespace "com.myapp"
    defaultConfig {
        applicationId "com.myapp.domain"
Hiragana answered 3/8, 2023 at 13:55 Comment(0)
C
1

It's very simple you just install npm library for same

npm i react-native-rename

Use the link for follow steps: https://www.npmjs.com/package/react-native-rename

NOTE: DON'T FORGET TO RUN BELOW COMMANDS AFTER FINISH YOUR WORK:

watchman watch-del-all
npm start --reset-cache
Cerate answered 17/8, 2023 at 14:31 Comment(0)
A
0

very simple way :

cd /your/project/dir

run this command :

grep -rl "com.your.app" . | xargs sed -i 's/com.your.app/com.yournew.newapp/g'

rename your folder

android/app/src/main/java/com/your/app

change to

android/app/src/main/java/com/yournew/newapp
Addia answered 16/11, 2020 at 12:31 Comment(0)
T
0

After renaming package name everywhere, from android studio. File -> Invalidate caches/Restart may fix this type of errors

this worked for me

Totter answered 15/3, 2021 at 20:42 Comment(0)
H
0

This information can be helpful for you so listen properly...

After updating package name and changing files, don't forget to change in 
package.json and app.json file at the root directory of your react native project

Otherwise you will get this error below

Invariant Violation: "Your new package name" has not been registered
Handkerchief answered 31/1, 2022 at 17:24 Comment(0)
B
0

Ivan Chernykh's answer is correct for react-native 0.67 and below For react-native 0.68 and above with the new architecture once you're down with the steps which Ivan Chernykh has mentioned

For android you have to go to app => src => main => jni folder

In MainApplicationTurboModuleManagerDelegate.h

change below line

static constexpr auto kJavaDescriptor =
      "Lcom/yournewpackagename/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";

In MainComponentsRegistry.h

 constexpr static auto kJavaDescriptor =
      "Lcom/yournewpackagename/newarchitecture/components/MainComponentsRegistry;"; 
Bonds answered 3/8, 2022 at 13:47 Comment(1)
Works, But it requires addition steps.. You also needs to change the "com.app" in each file inside "newarchitecture" folderSouthdown
O
0

I just learned this today but adding this answer to help others. You just need to add a namespace to the app/build.gradle that references the old name, like this:

defaultConfig {
  applicationId "com.mycompany.myapp"
  namespace "com.myapp"
}

Then you can have a bash script that changes the applicationId with something like this:

function sedi {
  if [ "$(uname)" == "Linux" ]; then
    \sed -i "$@"
  else
    \sed -i "" "$@"
  fi
}

bundle_name=com.mycompany.myapp

sedi -E "s/applicationId \"[-0-9a-zA-Z._]*\"/applicationId \"${bundle_name}\"/" android/app/build.gradle
Objectivism answered 18/11, 2022 at 19:48 Comment(0)
E
0

React [email protected] Tried to rename package name from com.x to com.y.z

I got through this painful process by doing these:

  1. Change displayName in app.json to z.
{
  "name": "<THIS_SHOULD_STAY_SAME>",
  "displayName": "<Z>"
}
  1. Change the content of the string app_name in strings.xml
<resources>
  ...
  <string name="app_name"><Z></string>
  ...
</resources>
  1. Search through your react-native project for com.x and replace all com.x with com.y.z

!important: In case you're using external services, and in case if you're generated a file and put it under /android you may want to make sure the services that you're using will still work. I recommend you to generate a new config file(s) using your new package name com.y.z and put it after the finishing the steps described below.

  1. Update the folder structure to this:
old: .../android/app/src/main/java/com/x
new: .../android/app/src/main/java/com/y/z
  1. Move all the files under .../android/app/src/main/java/com/x to .../android/app/src/main/java/com/y/z.

  2. Clean up.

  $ ./gradlew clean
  1. Build.
  $ react-native run-android
Execratory answered 26/12, 2022 at 23:53 Comment(0)
C
0

In my case,

I need to change the package com.yourProjectName to boonagency.connachttribune

enter image description here

So then I just do that:-

  1. yourApp/android/app/build.gradle

      defaultConfig {
      applicationId "com.connachtapp"
      minSdkVersion rootProject.ext.minSdkVersion
      targetSdkVersion rootProject.ext.targetSdkVersion
      versionCode 1
      versionName "1.0"
    

to

    defaultConfig {
    applicationId "boonagency.connachttribune"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 1
    versionName "1.0"

enter image description here

  1. yourProjectName/android/app/src/main/AndroidManifest.xml

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

to

  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="boonagency.connachttribune">
  1. change folder name

    yourProjectName/android/app/src/main/java/com/connachtapp
    

    to

     yourProjectName/android/app/src/main/java/boonagency/connachtapp 
    
  2. yourProjectName/android/app/src/main/java/boonagency/connachtapp/MainApplication.java

    package boonagency.connachttribune; // change here
    ...
    import boonagency.connachttribune.newarchitecture.MainApplicationReactNativeHost; // change here
    ...
     Class<?> aClass = Class.forName("boonagency.connachttribune.ReactNativeFlipper"); // change here
    
  3. yourProjectName/android/app/src/main/java/boonagency/connachtapp/MainActivity.java

    package boonagency.connachttribune; // change here
    
  4. yourProjectName/android/app/src/main/java/boonagency/connachtapp/newarchitecture/MainApplicationReactNativeHost.java

enter image description here

  1. yourProjectName/android/app/src/main/java/boonagency/connachtapp/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java

    package boonagency.connachttribune.newarchitecture.modules; // change here
    
  2. yourProjectName/android/app/src/main/java/boonagency/connachtapp/newarchitecture/components/MainComponentsRegistry.java

    package boonagency.connachttribune.newarchitecture.components; // change here
    
  3. last just run

    cd android && ./gradlew clean && cd .. && npm run android 
    
Consultation answered 15/6, 2023 at 7:36 Comment(0)
S
0

There are lots of way to rename a react native project But, I recommend a package named react-native-rename. It take care all the renaming procedures without any issues

https://www.npmjs.com/package/react-native-rename

Shogun answered 27/2 at 6:51 Comment(0)
G
-3

Go to file android/app/src/main/AndroidManifest.xml -

Update :

attr android:label of Element application as :

Old value - android:label="@string/app_name"

New Value - android:label="(string you want to put)"

and

attr android:label of Element activity as :

Old value - android:label="@string/app_name"

New Value - android:label="(string you want to put)"

Worked for me, hopefully it will help.

Gazebo answered 23/5, 2016 at 13:5 Comment(1)
I honestly don't think this answer should've been downvoted as much as it has been. However, this answer does not address what was asked in the question - how to change the package name. Yet, it answers the question "how to change the title of of the app that appears in the launcher". Is it a relevant answer? Not really. Does it contain useful information? Yes. Therefore, I suggest you find a question which asks about the launcher title and post your solution there instead of here.Reinhart

© 2022 - 2024 — McMap. All rights reserved.