-
Notifications
You must be signed in to change notification settings - Fork 490
How to change app name? #465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
ps. The ReactXP project creator ... Will NOT use "MyProject" as the name in package.json. So I need to be able to change the app name somehow. |
The name in you app’s package.json is irrelevant. You can ignore it or change it to anything you like. This field is used only for packages that are published through npm and referenced by other packages. |
if I change the value of name in package.json, and then if I delete the android folder, and then in main folder (from node.js command prompt), I do an "react-native upgrade", it will recreate android folder and it will use the name in package.json in both ios + android files (MainApplication.java in android subfolder is just one example). So the value of name in package.json is relevant. |
Even though the name seems to be changed in the relevant android files.....there still is something missing because I can't run it in emulator, because it doesn't get registered somewhere... I suspect it has to do with AppRegistry.registerComponent, but I don't see that being done anywhere. |
I'm not very familiar with these tools, but here's my guess to what's happening. The code that To fix this, and get all the benefits of RXP, you should:
Be careful using react-native tooling and expecting it to work with RXP. Some will work as expected, but others will not. To answer your original question, Android apps set their name in |
This gets changed to new name...the main issue is, I should be able to at least create a new project with the RXP create-xp-app tool. I don't seem to be able to do this (the default project always uses "rxp-hello-world") I'll check on #2, and see what is done in app. |
Apparently all hell breaks loose when you try to change the name...
(this is for android build on Windows 10 pc)
The way you're supposed be able to do this is....
...
"name": "rxp-jupiter",
...
react-native upgrade.
This will re-creacte the android folder using the new name in the appropriate files
But it is incorrect, as it uses the "-", when it should drop the "-"
for example, in MainActivity.java and MainApplication.java, it has
package com.rxp-jupiter;
and the path to the files also uses the "-"
android\app\src\main\java\com\rxp-jupiter\MainActivity.java
It SHOULD BE.....
package com.rxpjupiter; (with the "-" dropped)
and the path to the files, should also drop the "-"
android\app\src\main\java\com\rxpjupiter\MainActivity.java
Now if I go back to package.json, and change the name, to not use any dashes
"name": "rxpjupiter",
and do "react-native upgrade"
I have no issues, and I have to go to Android studio, and import the Android app (by clicking on android folder), it will ask to upgrade to gradle 4.0, which I do, then I can build the project, then if I go to Run->debug 'app' in Android Studio, it will install the app on the emulator that I have running.
At this point, I get an error about bundler server...
I then open a node.js command prompt and CD to folder, and do an "npm start"
Then in emulator I reload the app, I can see in command prompt the bundle server is now working...but at the end I then get the red screen on the emulator with this error : "Application rxpjupiter has not been registered"
So there is some place where rxpjupiter is not used or updated to it, or what, I don't know....
How do I properly change/update app name for ReactXP project?
How do I fix the "not been registered" error
The text was updated successfully, but these errors were encountered: