The problem is that CMake might be installed as a part of the Android Studio installation, and not installed system-wide; then on surface CMake part of the native build works alright; however this particular cmake build step, executed as a child build process, will fail (because calling cmake command it now assumes system-wide cmake command, and does not find the one coming from Android Studio installation) silently (because the fail-on-error options are commented out in favor of supporting older CMake versions). In result, the outer CMake build continues and fails further below saying it could not find PCRE2 library (which silently failed to build); or, presumably, if there is a system-wide PCRE2 library installation, not suitable for Android, it may try to use that in fail in other obscure ways down the line.
TODO: Figure out how to update the command to ensure we are using the same cmake Android Studio uses.
The following might cause an obscure failure when building for Android on Ubuntu host (probably on other build host systems as well): https://github.com/birdofpreyru/react-native-static-server/blob/9758fe6526f438bd6fc376c313102f0622c7c4f1/CMakeLists.txt#L65-L78
The problem is that CMake might be installed as a part of the Android Studio installation, and not installed system-wide; then on surface CMake part of the native build works alright; however this particular
cmake
build step, executed as a child build process, will fail (because callingcmake
command it now assumes system-widecmake
command, and does not find the one coming from Android Studio installation) silently (because the fail-on-error options are commented out in favor of supporting older CMake versions). In result, the outer CMake build continues and fails further below saying it could not find PCRE2 library (which silently failed to build); or, presumably, if there is a system-wide PCRE2 library installation, not suitable for Android, it may try to use that in fail in other obscure ways down the line.TODO: Figure out how to update the command to ensure we are using the same
cmake
Android Studio uses.