birdofpreyru / react-native-static-server

Embedded HTTP server for React Native
https://dr.pogodin.studio/docs/react-native-static-server
Other
135 stars 21 forks source link

Building Android on Windows resulted in the following error #89

Open ShaoGongBra opened 9 months ago

ShaoGongBra commented 9 months ago

adding property to lighttpd-angel COMPILE_FLAGS: -DSBIN_DIR=\"C:/Program Files (x86)/rn-static-server/sbin\" CMake Error at lighttpd1.4/scripts/cmake/LighttpdMacros.cmake:37 (foreach): Syntax error in cmake code at

D:/project/screenpublishapp/node_modules/@dr.pogodin/react-native-static-server/lighttpd1.4/scripts/cmake/LighttpdMacros.cmake:37

when parsing string

Process failed because: %1 不是有效的 Win32 应用程序。for command: D:\project\screenpublishapp\node_modules\@dr.pogodin\react-native-static-server\android\.cxx\Debug\4s5s6w42\x86_64\sysroot\bin\pcre2-config --cflags

Invalid character escape '\p'. Call Stack (most recent call first): lighttpd1.4/src/CMakeLists.txt:1064 (add_target_properties)

birdofpreyru commented 9 months ago

I had a brief look on it. The issue happens here:

https://github.com/birdofpreyru/lighttpd1.4/blob/ec31534cb9d0eba386c4be2753eda0482263bf0c/src/CMakeLists.txt#L547-L554

As of now, I don't have much interest to spend my time trying to figure out how to correct it for Android builds on Windows, without breaking builds for other platforms / targets. Probably, the Windows > Android builds requires to configure something different in https://github.com/birdofpreyru/react-native-static-server/blob/master/CMakeLists.txt , which contains a bunch of platform / target specific configs, which are picked up by Lighttpd build down the line.

Thus, I'll mark this ticket as On Hold, and not planning to do anything further in the foreseeable future. My best advise is to do Android-aiming builds on Ubuntu or macOS host. Mind as well that (#20) Android-aiming builds on Windows with the new RN architecture do not work anyway for different reasons (bugs in RN itself).

In other words, prior to a further notice the Android builds on Windows host are not officially supported.

ShaoGongBra commented 9 months ago

Thank you, I will test it with macos tomorrow