'react native android build error (on mac) - unexpected end of file (gradlew)
I am using a mac mini M1 to build a react native app for Android. The app builds fine on my windows computer, but when trying to build on my mac mini I get the error
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
./gradlew: line 188: syntax error: unexpected end of file
Im wondering if this has anything to do with fact that I created the app originally on Windows.....and this is the first time Im trying to build on Mac? I checked gradlew file in VSCode and its showing as LF (not CRLF) which as I understand it is correct when building for Mac
Solution 1:[1]
This error is most likely caused by a mismatch in the line endings of your files. On Windows, line endings are typically represented by carriage return + line feed (CRLF), while on Unix-based systems they are just represented by line feed (LF).
To fix this, you can either convert all of your files to use LF endings (if you are using a Unix-based system) or CRLF endings (if you are using Windows), or you can set the lineSeparator
property in your gradle.properties
file to match the Line Separator of your operating system. More information on this can be found in the Gradle documentation here: https://docs.gradle.org/current/userguide/userguide.html
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Carter McKay |