-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
react-native-git-upgrade does not respect android package name #16217
Comments
I just ran into this same issue. I had to rename my android package to make react-native-git-upgrade happy, do the upgrade, then rename it back. Not a recommended solution. |
Same issue here, attempted a manual upgrade and having some troubles. Will try @richardgirges's workaround. |
My workaround (this time) was to copy my existing MainApplication.java to the path react-native-git-upgrade expects, run the upgrade and then copy the file back to the correct path. |
yeah... @nikolaik's workaround worked for me. Not sure where react-native-git-upgrade is getting the old package name from. I couldn't find any references to the old name of my package anywhere in my code |
I'm experiencing the same issue as I changed my Android package name to be in the form @SirNeuman It seems like it should be possible to update In the meantime, I was also able to use the workaround posted by @nikolaik. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
This will keep affecting people for every update of the |
Yeah this issue should definitely remain open. It seems like it should be fairly easy/straightforward to fix (at least with my suggested solution of inspecting |
Is there a place someone could submit a PR to try to fix this issue? |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Steps to Reproduce
react-native init MyProject --version 0.48.3
com.myproject
package / applicationId tocom.my.new.project
according to this SO answer: https://stackoverflow.com/a/37390022/543864react-native-git-upgrade
to upgrade to 0.49.1 (or higher) which failes silently like described in react-native-git-upgrade changes nothing #12112There is a similar issue #11163 from when MainApplication.java was introduced in 0.29.
Expected Behavior
Running react-native-git-upgrade in step 3 uses the current Android package name by either parsing AndroidManifest.xml or accepting the package name as a param (ie.
react-native-git-upgrade --package com.my.new.project
and patches MainApplication.java in the correct path (ie.com/my/new/project
).It looks like
react-native init
took a package param in version 0.38 which was later removed. That code could be used as a basis for either a--package
option to react-native-git-upgrade or parsing AndroidManifest.xml. What is the best approach?Actual Behavior
Running
react-native-git-upgrade
in step 3 fails silently like described in #12112 because it tried to patch a file that is not in the git index. It tried to patchcom/myproject/MainApplication.java
instead ofcom/my/new/project/MainApplication.java
.Reproducible Demo
Follow the steps under Steps to Reproduce.
The text was updated successfully, but these errors were encountered: