-
Notifications
You must be signed in to change notification settings - Fork 906
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
init with --package option #1111
Comments
Hey! Could you explain what do you expect from |
for setting android app package name and ios |
It is super necessary for Android apps. |
I think it's only super necessary for you. There was close to zero interest in such request since a few years now. You can quickly find/replace the package name anyway. |
@thymikee Is not a simple search/replace. You need to rename folders too. Is super annoying. BTW this feature was in CLI before and was removed. |
I'm sorry, but I have no idea why it was removed (according to SO answer linked here, it was removed in RN 0.40+ and the CLI was extracted around RN 0.59, same time I started contributing), never used that. Maybe you could dig and find the rationale behind that? |
There is a special tool react-native-rename for doing that, which has be downloaded 199k times for now. I think it's a common requirement. |
@arniu thanks, didn't know about this project! I feel we should embrace it and mention somewhere in the docs, what do you think? |
@thymikee there is no need to mention a tool if you have it out of the box. Initializing projects with Android Studio have a step to input the package name, so I think this should be implemented in CLI, but maybe with another option ( |
I still think it would be nice to give a shoutout to a tool that's helpful when one want to change it. @artyorsh Let's give it a shot then, hope it's not gonna add too much of maintenance burden. |
@thymikee I think it's necessary to have it since it is officially supported by both IDEs when starting a new project. Also, since neither Android Studio nor Xcode has no Will try adding this option then 👍 |
BTW I did try to use react-native-rename and it didn't work. The last version is from one year ago. |
React-native-rename sometimes didn't work. Please add this feature to CLI. |
What is the status of this? I would imagine that this is a hard requirement for most people who release their apps, and it would be lovely to not have to resort to an external tool to do the renaming afterwards. |
I think the status is we're closing it and your attention would be better used to make |
Frankly it's ridiculous that there's even a need to have a separate (Yes, there is the rare use-case where you need to later on change the package name and |
@plaa first of all, please stop being passive aggressive towards the project maintainers. Send a proposal if you're so certain this is a necessary feature. Code wins arguments :) I disagree it's ridiculous to not have this functionality. The package name is created based on the required ProjectName argument and it works for the majority of use cases I suppose, never really bothered me as a user. I once needed a rename though. |
Just wonder, if i only person who rename android package name each time i setup RN project? |
I apologize for my rather harsh words, I should have elaborated more. I'm also sorry that I don't have enough free time to dig into the project to fix it myself. Once published, the bundle ID cannot be changed. It's set for life. This means that the developers should take a moment to consider what it should be and not just take some auto-generated ID. The bundle IDs are traditionally recommended to be reverse-domain names – though it seems that Google & Apple have later removed this recommendation from their own documentation. In many cases you don't own the Based on these, I'd argue that the bundle ID should be a mandatory option, to force developers to take a moment to consider what a good bundle ID for them should be. Sure, keep an auto-generated option for Hello World projects, but at least provide an option to set it for those who care (which should be everyone planning to release the app). Also, any rename tool is always playing catch-up with init. I was able to rename my bundle ID with it, but it missed one file – probably changed after the tool has been implemented/updated. I completely understand if the maintainers don't have time to implement this, but closing this issue and asking everyone to use a separate somewhat-working tool (which isn't even mentioned in the documentation) to do the job is just ridiculous. |
when creating a project through xcode and android studio, they both assume i just tried, and the react-native cli doesnt support the dot(.) when creating a project. which means EVERY single react native project must use react-native-rename, if they want to change package name/applicationId/bundle identifier. and anyone who doesnt know this can never change it after deploying. and many others also report problems with react-native-rename. i can also still find references to the old name after renaming. it would be very nice if we could just have this sorted out at the creation of the project, and not something you feel like you always have to do after creating the project. |
Can this be reopened? I have a case with a series of incoming white-label apps that need to be prefixed with a |
The quickest way I did it was to open the project folder in my editor. Then, do a project wide search and replace from the default package name e.g. "com.newapp" - and replace with whatever package name you want e.g. "com.company.project". That finds and replaces about 15 occurrences of the default package name to the required package name across a number of files. Then, you have to rename the folder structure from project/android/app/src/main/java/com/newapp to match your new package name. e.g. project/android/app/src/main/java/com/company/project (making sure you keep all the files in the bottom folder of that file structure) Then, it works. But would be a million times easier if react-native init could just have a --package option. |
This comment was marked as abuse.
This comment was marked as abuse.
Yeah com.companyname.appname - it should make the directories... java/com/companyname/appname |
I can't believe you have to do this by hand! OMG!!!! |
This is how to do it:
|
this is the best answer here. Im not sure why they dont add this information into the getting started documentation |
First of all tool is great.
But react-native init has a option for packagename.
why npx react-native init getting --package option?
Thank you :)
The text was updated successfully, but these errors were encountered: