Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Android on Windows resulted in the following error #89

Open
ShaoGongBra opened this issue Nov 29, 2023 · 2 comments
Open

Building Android on Windows resulted in the following error #89

ShaoGongBra opened this issue Nov 29, 2023 · 2 comments
Labels
On Hold Cannot be resolved at the moment. P2 Important issue. Windows -> Android Android builds on Windows host

Comments

@ShaoGongBra
Copy link

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 birdofpreyru added the P2 Important issue. label Nov 29, 2023
@birdofpreyru
Copy link
Owner

birdofpreyru commented Nov 29, 2023

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

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

  • PRCE2 itself seems to build fine for the target Android arch, and it can be found inside android/.cxx/.../.../.../sysroot folder of library directory.
  • When Lighttpd builds, at the lines I referenced above, it somehow can't locate pre-built PCRE2 using pkg_check_modules() command, thus it falls through to attempt locating it with xconfig(pcre2-config ...) command, and it does not work because in that case it somehow finds pcre2-config inside android/.cxx/.../.../.../sysroot/bin/pcre2-config, tries to run it, and fails as was build for Android.

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.

@birdofpreyru birdofpreyru added On Hold Cannot be resolved at the moment. Windows -> Android Android builds on Windows host labels Nov 29, 2023
@ShaoGongBra
Copy link
Author

Thank you, I will test it with macos tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Hold Cannot be resolved at the moment. P2 Important issue. Windows -> Android Android builds on Windows host
Projects
None yet
Development

No branches or pull requests

2 participants