phamha98 / hi

note
Other
2 stars 0 forks source link

Change package name for Android in React Native #8

Open phamha98 opened 2 years ago

phamha98 commented 2 years ago

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?

phamha98 commented 2 years ago

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