junedomingo / react-native-rename

Rename react-native app with just one command
MIT License
2.63k stars 261 forks source link

React Native 0.71.1 android, not renaming package in release folder #192

Closed mistakenelf closed 1 year ago

mistakenelf commented 1 year ago

Describe the bug Running rename on a new 0.71.1 react native project, the ReactNativeFlipper.java file does not get its package name updated and associated folder changes in the release folder of android.

To Reproduce Steps to reproduce the behavior:

  1. Create new react-native project
  2. Run npx react-native-rename "AwesomeProject" -b "com.new.bundle"

Expected behavior Expected to see the ReactNativeFlipper.java file to get its package name updated along with the directory structure.

Environment (please complete the following information):

junedomingo commented 1 year ago

Hi @knipferrc , the new path for ReactNativeFlipper.java has been added since v3.2.9.

also the previous folder "android/app/src/release/java/com/awesomeproject" is currently not being deleted but, every content from there should be moved to "android/app/src/release/java/com/new/bundle".

Screenshot 2023-01-31 at 9 43 49 AM
mistakenelf commented 1 year ago

@junedomingo Yeah I saw support was added in 3.2.9, but for some reason for me, its ignoring the release folder. Created a fresh react-native project and this is whats happening for me. It renames everything else but not the release folder. I had to add package name to the AndroidManifest.xml file as well for it to run. Maybe i'm doing something incorrectly?

image

junedomingo commented 1 year ago

I think you're using the old version. try npx react-native-rename@latest "AwesomeProject" -b "com.test.app"

mistakenelf commented 1 year ago

ahh ok yeah that seems to be the case. After adding the latest tag on there it worked. I think the reason its not working in my other app is the app name is only 3 characters which seems to throw and error since the minimum character count is 4. Any way around that?

junedomingo commented 1 year ago

For names, the minimum is 1 and the maximum is 30. If your app name only contains < 4 valid characters, it will ask you to provide pathContentStr to be used in renaming the folders, files, and their contents.

What you can do is something like this npx react-native-rename@latest "Awe" -p "AwesomeApp" -b "com.awesome.app".

pathContentStr - a string that is close to your app name

mistakenelf commented 1 year ago

When passing a content string though it looks like it’s renaming it to that string. Is there a way to keep the name at the 3 valid characters as I would prefer not to change it. Really I just need to be able to change the bundle ids and not the name

junedomingo commented 1 year ago

@knipferrc could you provide an example? name and bundleId? (with exact number of characters)

junedomingo commented 1 year ago
npx react-native-rename@latest "dem" -p "demo app"
ios/demoapp RENAMED
ios/demoapp.xcworkspace RENAMED
ios/demoappTests RENAMED
ios/demoappTests/demoappTests.m RENAMED

above, it uses a 3-character name "dem", if your run it, your app should be named "dem"

junedomingo commented 1 year ago

I will close this now as the real issue was already resolved.