Skip to content

[Android] 0.20 to 0.21 Manual Upgrade Documentation #6238

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

Closed
jeffchienzabinet opened this issue Mar 2, 2016 · 12 comments
Closed

[Android] 0.20 to 0.21 Manual Upgrade Documentation #6238

jeffchienzabinet opened this issue Mar 2, 2016 · 12 comments
Assignees
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.

Comments

@jeffchienzabinet
Copy link
Contributor

There's documentation for manual upgrade from 0.13 to 0.14 on iOS but there's no documentation on the upgrade from 0.20 to 0.21 on Android. I've made changes to my project that seems to break compatibility with the yeoman generator (my node package name has a dash so when it tries to use that for the Java package name it fails) so knowing how to do it manually is probably more convenient than trying to fix the upgrade script for my edge case.

https://github.com/facebook/react-native/blob/master/docs/Upgrading.md

@mkonicek
Copy link
Contributor

mkonicek commented Mar 4, 2016

my node package name has a dash

We'll need some example code / project to understand what this means.

@satya164
Copy link
Contributor

satya164 commented Mar 4, 2016

@mkonicek The name field in package.json has a - which is not supported in an android package name. Right now we use the name field to generate a package name, which we should probably change in the future.

@jeffchienzabinet
Copy link
Contributor Author

@satya164 nailed the issue.

@brentvatne
Copy link
Collaborator

So we have a decision that needs to be made here: do we update the Android generator script to properly deal dashes in the package name or do we add docs to the upgrade process? It seems to me that we should be dealing with this edge case.

I am strongly in favour of fixing the Android generator script. The following plan should be a good guide for any interested contributor:

Implementation Plan: This should not be too hard, we can just strip invalid characters from the generated package name here: https://github.com/facebook/react-native/blob/master/local-cli/generator-android/index.js

Test Plan: Add a test to https://github.com/facebook/react-native/blob/master/local-cli/__tests__/generators-test.js to generate a project with a name like "hello-world" and ensure that replaces the package name correctly.

Contributions are very welcome! This is a great first ticket.

@brentvatne brentvatne added Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Community Responsibility Help Wanted :octocat: Issues ideal for external contributors. and removed Needs more information labels Mar 6, 2016
@satya164
Copy link
Contributor

satya164 commented Mar 6, 2016

@brentvatne I think custom package names can cover a wider use case. Most packages (at least on android) follow the format domain.company.name, and I think we should support this use case (I can give it a try). But of course it's not as simple as stripping out invalid characters. I think we can go with stripping the characters first, then we can add support for customizing the package name.

@brentvatne
Copy link
Collaborator

@satya164 - it looks like you can customize the package name when you init the project by providing the package option: https://github.com/facebook/react-native/blob/master/local-cli/__tests__/generators-test.js#L111-L116

Do we just need to make this work with upgrade? Let's decide on this and update our implementation and test plan.

@satya164
Copy link
Contributor

satya164 commented Mar 6, 2016

@brentvatne Wut! Never knew this existed. I'll test if it works with react-native upgrade, and if does, update the docs, otherwise try making it work with upgrade. Thank you.

@brentvatne
Copy link
Collaborator

Haha awesome :) I assigned you so it's clear who is taking over this one

@pyrech
Copy link

pyrech commented Jul 21, 2016

Will this issue be fixed in some day? As far as I can see, it's still present with RN v0.30
Dashes are pretty often used in package name, so it would be cool to handle them correctly :)

@satya164
Copy link
Contributor

@pyrech Haven't gotten time to look into it yet. Feel free to take this up if you want.

@mkonicek
Copy link
Contributor

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/android-020-to-021-manual-upgrade-documentation

Product Pains has been very useful in highlighting the top bugs and feature requests:
https://productpains.com/product/react-native?tab=top

Also, if this issue is a bug, please consider sending a pull request with a fix.

@jpshelley
Copy link
Contributor

I'm still having this issue on my upgrades as mentioned above.
My React Native directory and project name in my package.json is hudl-messaging.
However my Android project should be com.hudl.messaging. How would I go about defining this so my upgrade works? I'm trying to upgrade from 0.35 to 0.37.

@hramos hramos added Help Wanted :octocat: Issues ideal for external contributors. and removed Help Wanted :octocat: Issues ideal for external contributors. labels Mar 8, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

10 participants