Skip to content
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

Auto Linking Fails for Android if build.gradle uses CRLF line endings #18244

Closed
sujayjaju opened this issue Mar 7, 2018 · 3 comments
Closed
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided.

Comments

@sujayjaju
Copy link
Contributor

Native projects don't get added to build.gradle if the file uses CRLF (\r\n)

Environment

Environment:
OS: Windows 10
Node: 8.9.4
Yarn: 1.3.2
npm: 5.2.0
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.0.0.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.50.4 => 0.50.4

Expected Behavior

compile project(':react-native-package-name') should get added to dependencies in build.gradle

Actual Behavior

MainApplication.java and settings.gradle get updated. But build.gradle does not.

Steps to Reproduce

  1. Change android/app/build.gradle file's line ending format to CRLF
  2. Install an native package and run 'react-native link {native-package-name}
sujayjaju added a commit to sujayjaju/react-native that referenced this issue Mar 7, 2018
Fix for facebook#18244
Add support for build.gradle with CRLF based line ending when running react-native link
@hramos hramos added the Android label Mar 8, 2018
@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Mar 18, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@hramos
Copy link
Contributor

hramos commented Mar 26, 2018

Have you reproduced this in 0.54?

@sujayjaju
Copy link
Contributor Author

Yes. The issue is clear in the code base. Its a simple fix as per the PR.

sujayjaju added a commit to sujayjaju/react-native that referenced this issue Apr 7, 2018
Fix for facebook#18244
Add support for build.gradle with CRLF based line ending when running react-native link
@hramos hramos added Resolution: PR Submitted A pull request with a fix has been provided. and removed ⏪Old Version labels Apr 9, 2018
@ssonalm
Copy link

ssonalm commented Jun 18, 2018

build.gradle error expecting ''', found '\n' @ line.
what this error is and how to resolve it??

macdoum1 pushed a commit to macdoum1/react-native that referenced this issue Jun 28, 2018
Summary:
Fix for facebook#18244
Add support for build.gradle with CRLF based line ending when running react-native link

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

`react native link` fails if andorid/app/build.gradle has CRLF based line endings.

Minor 3 character code change.
Ran `react native link` on Windows and Mac to verify.

None

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
 [CLI] [BUGFIX] [local-cli/link/android/patches/makeBuildPath.js] - Support CRLF line endings
Closes facebook#18245

Differential Revision: D8044774

Pulled By: hramos

fbshipit-source-id: 93fad3db7022784ee949936777aa5ac25e3a64a3
@facebook facebook locked as resolved and limited conversation to collaborators May 25, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided.
Projects
None yet
Development

No branches or pull requests

7 participants
@hramos @sujayjaju @janicduplessis @ssonalm @kelset @react-native-bot and others