2

After some research I renamed my cloned react native project and it works but I got a warning message, I'm worried about future problems because this message mainly for Google Play publishing and security.
The process was:

# PowerShell7:  
cd C:\myDevFolder  
rm -R C:\myDevFolder\myNewProjectName  
git clone https://github.com/someRepo0000001/someProj00001.git myNewProjectName  
cd C:\myDevFolder\myNewProjectName  
# replace every myOLDProjectName for myNewProjectName on every file  
cd .\android\app\src\main\java\com\  
mv .\myOLDProjectName\ .\myNewProjectName\  
cd C:\myDevFolder\myNewProjectName  
cd .\ios\  
mv .\myOLDProjectName\ .\myNewProjectName\  
mv .\myOLDProjectName-tvOS\ .\myNewProjectName-tvOS\  
mv .\myOLDProjectName-tvOSTests\ .\myNewProjectName-tvOSTests\  
mv .\myOLDProjectName.xcodeproj\ .\myNewProjectName.xcodeproj\  
mv .\myOLDProjectName.xcworkspace\ .\myNewProjectName.xcworkspace\  
mv .\myOLDProjectNameTests\ .\myNewProjectNameTests\  
cd C:\myDevFolder\myNewProjectName  
yarn  
npx react-native run-android  

The warning message was:

warn Invalid application's package name "com.myNewProjectName" in 
'AndroidManifest.xml'. Read guidelines for setting the package name here: 
https://developer.android.com/studio/build/application-id

Others rename process I found dont works, including the most viewed page about it here: Renaming a React Native project?

john
  • 21
  • 1

1 Answers1

1

There multiple places where you should replace the old name with the new one So as an easy solution change the name with react-native-rename package

react-native-rename "new name"

and reset the cache

Salem_Raouf
  • 400
  • 5
  • 10