We have an Android build issue related to this library, on windows.
I've found similar issue on other repositories, where the fix is made by doing os-specific formatting in the build.gradle
file. Eg :
Kudo/react-native-v8@5a2107f
I've tried both solutions locally, they work and allow me to build and run my Android app on Windows.
PS D:\.....> yarn android
yarn run v1.22.19
$ react-native run-android
info A dev server is already running for this project on port 8081.
info Installing the app...
> Task :react-native-pkce-challenge:configureCMakeDebug[arm64-v8a] FAILED
C/C++: CMake Error at CMakeLists.txt:7 (add_library):
C/C++: Syntax error in cmake code when parsing string
C/C++: D:\.....\android/../node_modules/react-native/ReactCommon/jsi/jsi/jsi.cpp
C/C++: Invalid character escape '\w'.
337 actionable tasks: 2 executed, 335 up-to-date
info ๐ก Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-pkce-challenge:configureCMakeDebug[arm64-v8a]'.
> [CXX1429] error when building with cmake using D:\......\node_modules\react-native-pkce-challenge\android\CMakeLists.txt: -- Configuring incomplete, errors occurred!
See also "D:/......./node_modules/react-native-pkce-challenge/android/.cxx/Debug/493k3528/arm64-v8a/CMakeFiles/CMakeOutput.log".
C++ build system [configure] failed while executing:
@echo off
"C:\\.....\\android-sdk\\cmake\\3.22.1\\bin\\cmake.exe" ^
"-HD:\\......\\node_modules\\react-native-pkce-challenge\\android" ^
"-DCMAKE_SYSTEM_NAME=Android" ^
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^
"-DCMAKE_SYSTEM_VERSION=21" ^
"-DANDROID_PLATFORM=android-21" ^
"-DANDROID_ABI=arm64-v8a" ^
"-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" ^
"-DANDROID_NDK=C:\\.....\\android-sdk\\ndk\\25.1.8937393" ^
"-DCMAKE_ANDROID_NDK=C:\\.....\\android-sdk\\ndk\\25.1.8937393" ^
"-DCMAKE_TOOLCHAIN_FILE=C:\\.....\\android-sdk\\ndk\\25.1.8937393\\build\\cmake\\android.toolchain.cmake" ^
"-DCMAKE_MAKE_PROGRAM=C:\\.....\\android-sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
"-DCMAKE_CXX_FLAGS=-O2 -frtti -fexceptions -Wall -fstack-protector-all" ^
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\\.....\\node_modules\\react-native-pkce-challenge\\android\\build\\intermediates\\cxx\\Debug\\493k3528\\obj\\arm64-v8a" ^
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\\.....\\node_modules\\react-native-pkce-challenge\\android\\build\\intermediates\\cxx\\Debug\\493k3528\\obj\\arm64-v8a" ^
"-DCMAKE_BUILD_TYPE=Debug" ^
"-BD:\\.....\\node_modules\\react-native-pkce-challenge\\android\\.cxx\\Debug\\493k3528\\arm64-v8a" ^
-GNinja ^
>>>>> "-DNODE_MODULES_DIR=D:\\.....\\android/../node_modules" <<<<<
from D:\.....\node_modules\react-native-pkce-challenge\android
CMake Error at CMakeLists.txt:7 (add_library):
Syntax error in cmake code when parsing string
D:\.....\android/../node_modules/react-native/ReactCommon/jsi/jsi/jsi.cpp
Invalid character escape '\w'.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.