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?
Best Answer
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:
In android/app/src/main/java/MY/APP/NEW_ID/MainApplication.java:
In android/app/src/main/AndroidManifest.xml:
And in android/app/build.gradle:
In android/app/BUCK:
Gradle' cleaning in the end (in /android folder):