I need to change the name of my React Native Android project.
I changed my app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.[new name here]">
but when I try to build a release apk I get the following error
:app:compileReleaseJavaWithJavac
/Users/harrymoreno/programming/contactsPro/android/app/src/main/java/com/contactspro/MainActivity.java:34: error: cannot find symbol
.setUseDeveloperSupport(BuildConfig.DEBUG)
^
symbol: variable BuildConfig
location: class MainActivity
1 error
:app:compileReleaseJavaWithJavac FAILED
I solved this by searching through the entire project for instances of the old project name using ripgrep and replacing the string in some places (don't try the files listing strings). At least 4 files need to be edited in order to change app name.
android/app/src/main/AndroidManifest.xml
android/app/src/main/PATH/TO/JAVA/FILES/MainActivity.java
android/app/src/main/PATH/TO/JAVA/FILES/MainApplication.java
/android/app/build.gradle
for example in /android/app/build.gradle
android {
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.[change name]"
minSdkVersion 16
targetSdkVersion 22
versionCode 2
/android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.[change name]">
/android/app/src/main/java/com/contactspro/MainActivity.java
package com.[change name];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With