1

I have a working react native app (without expo), running and compiling in both Android and iOS devices. Now I'm trying to rename the app, but I'm having problems with that.

Steps followed:

  • I have deleted both ios and android directories.
  • Changed the project name in my app.json
  • Regenerated the android and ios directories with react-native upgrade --legacy (cause eject is not working anymore)
  • Updated my podfile with the need
  • Pod install

When i tried to compile my app via xcode, I got "null is not an object (evaluating '_RNGestureHandlerModule.default.Direction')

I guessed that was due to the autolinking when you install some react native third party components. So I deleted node_modules, and installed all react native navigation again. Then I ran react-native link. The previous error went away.

Now, I'm stuck with:

Target 'cjlrnneTests' has target dependency on Target 'cjlrnne'

That command depends on command in Target 'cjlrnne': script phase “[CP] Copy Pods Resources”

Honestly, I don't know what else more to do / look for.

Can anyone please provide with some clue, or the steps to change a RN app's name?

Thanks!

Chux
  • 1,196
  • 1
  • 9
  • 24
  • Have you tried using https://www.npmjs.com/package/react-native-rename – Dan Oct 21 '19 at 11:05
  • No i haven't, i'm trying to do it all by myself to understand the whole process – Chux Oct 21 '19 at 11:06
  • No worries, if you find yourself at a loose end, you could always take a look at the src code and look at what the scripts are doing. – Dan Oct 21 '19 at 11:15
  • Will try it later, thanks ;) – Chux Oct 21 '19 at 11:16
  • I think the safest way is to create another project with the new name and install dependencies again because you're dealing with complex batches for both iOS and Android – Ahmad Abdullah Oct 21 '19 at 11:22
  • Honestly i thought it would be simple, thats why i tried to do it by myself – Chux Oct 21 '19 at 11:26
  • Possible duplicate of [Renaming a React Native project?](https://stackoverflow.com/questions/32830046/renaming-a-react-native-project) – Tim Oct 21 '19 at 11:31
  • No. The "Renaming a React Native project" solution only talks about android. – Chux Oct 21 '19 at 11:32
  • finally did it with react-native-rename. Thanks everyone – Chux Oct 22 '19 at 10:09

1 Answers1

4

You can try this package for renaming the app. react-native-rename

https://www.npmjs.com/package/react-native-rename

react-native-rename <newName>

It will automatically configure all the things.

Vikas chhabra
  • 281
  • 1
  • 8
  • As i said above, I was looking for a way to do it by my self, to exactly know what are the steps involved. Will try your solution later. Thanks – Chux Oct 21 '19 at 11:16