birdofpreyru / react-native-static-server

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

Builds for Android on Windows host, fail when using RN's New Arch; presumably due to bugs in RN itself #20

Open charlyschulte opened 1 year ago

charlyschulte commented 1 year ago

Thanks for your work. i tried building the library on windows/ android and first got the error "pcre2.h couldn't be found" i also tried settings the "-DWITH_PCRE2=OFF" intro the build.gradle, but got the error "the command cc is wrongly typed or not found"

i have also tried running it in wsl, but no luck either.

Can you please help me? thanks so much in advance

birdofpreyru commented 1 year ago

Ogh... did it work before and broke in the last, v0.7.1 release? It sounds like I messed it up for Android builds on Windows in v0.7.1 when solving #18 for iOS :man_facepalming: Or... actually I have not tested Android builds on Windows at all, I do all my Android-target development on Ubuntu, so probably it was not working at all on Windows. I'll look into it eventually, but if you are up to try solving it yourself, I guess there are two problems: one that current CMakeList.txt in the library root, and inside Lighttpd source fail to correctly link Lighttpd against PCRE2 also build from source as a part of Android build — this you have worked around by setting -DWITH_PCRE2=OFF, and then inside Lighttpd CMakeLists.txt there is a block which aims to build "lemon" tool with the build host's compiler, to use it later during the build — sounds like it also does not quite work as intended on Windows.

charlyschulte commented 1 year ago

First of all thanks for the fast response :) i will try building the 0.7.0 version for android for now. the problem is i have near to zero knowlege about cmake and building these modules myself :D

But if i can help you in anyway, i can try to do so

charlyschulte commented 1 year ago

update: i tried building with version 0.7.0 but got the same error but as you sad, it seems to have someting to do with "lemon"

birdofpreyru commented 1 year ago

v0.7.2 (just released) solves the problem with PCRE2 linking, and, in general, fixes Android-targeting builds on Windows, when using the old React Native architecture.

The Android-targeting builds on Windows using the new RN architecture still fail, but I believe it is due to bugs in React Native itself. At least, I have found and reported (https://github.com/facebook/react-native/issues/36475) one bug in the RN's codegen, but even if I fix that bug, the builds still fail later, due to some other issues in RN when doing Android builds on Windows host. Thus, I'll mark this issue On Hold for now, untill we can confirm the RN builds for Android with the new architecture work on Windows host in general.

andrewmunro commented 1 year ago

This also failed for me on OSX. I fixed it by running brew install pcre2

birdofpreyru commented 1 year ago

Hey @andrewmunro , can you help me with log details on how it failed originally? This library includes source code of PCRE2, builds it as a part of the build process, and is supposed to link it into the app, which all works fine on my system. Thus, it should be me still missing something in the build configuration, which make it fail on your system.

birdofpreyru commented 11 months ago

It should be re-tested — presumably a few fixes in latest 0.72 RN releases fixed the issue.

birdofpreyru commented 11 months ago

It still does not work (see https://github.com/facebook/react-native/issues/36475#issuecomment-1831910917).