I'm trying to set up webview in a clean React Native installation to test it. Here's the steps I took:
- react-native init webview
- cd webview
- yan add react-native-webview
- react-native link react-native-webview
- react-native run-android
However, it crashes with the following content:
$ react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
* Where:
Settings file 'C:\Users\Lucas10\ReactNative\webview\android\settings.gradle' line: 3
* What went wrong:
Could not compile settings file 'C:\Users\Lucas10\ReactNative\webview\android\settings.gradle'.
> startup failed:
settings file 'C:\Users\Lucas10\ReactNative\webview\android\settings.gradle':3: unexpected char: '\' @ line 3, column 117.
e_modules\react-native-webview\android')
If I edit android/settings.graddle, and replace:
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-webview\android')
With
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '..\\node_modules\\react-native-webview\\android')
It compiles normally.
This seems like a compatibility annoyance between react-native and Windows...?
How can I fix this so it don't have to tweak this manually every time I add a package?