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

Cannot build on macOS using Mac Catalyst "Command PhaseScriptExecution failed with a nonzero exit code" #17

Closed exotexot closed 1 year ago

exotexot commented 1 year ago

Hello!

I intend to use this version of react-native-static-server also on macOS using Mac Catalyst.

Build fails with error message: Command PhaseScriptExecution failed with a nonzero exit code

CMake Warning (dev) at CMakeLists.txt:25:
  Syntax Warning in cmake code at column 29

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:26:
  Syntax Warning in cmake code at column 30

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:27:
  Syntax Warning in cmake code at column 30

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/Platform/iOS-Initialize.cmake:4 (message):

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk
  is not an iOS SDK
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake:21 (include)
  CMakeLists.txt:1 (project)

-- Configuring incomplete, errors occurred!
See also "/Users/vinzenz/Library/Developer/Xcode/DerivedData/cat71-ftmmkuzomlcomofswditsemvhtqh/Build/Intermediates.noindex/Pods.build/Debug-maccatalyst/react-native-static-server.build/CMakeFiles/CMakeOutput.log".
Command PhaseScriptExecution failed with a nonzero exit code

I kind of hope that this can be an easy fix

Maybe there are some information to gain in this repo: https://github.com/leetal/ios-cmake

birdofpreyru commented 1 year ago

Hi @exotexot, I indeed have not arrived to test it with Mac Catalyst, I only build for iOS without it, targeting iPhones and iPads. The error log looks like it probably needs slight corrections of CMake configuration; or probably it requires testing and adjustments to work with https://microsoft.github.io/react-native-windows (as it is actually called React Native for Windows + MacOS). Also, can't check it right now, as I am travelling this week, and only have hardware for macOS / iOS development at my home base :)

birdofpreyru commented 1 year ago

Fixed in v0.7.4.

exotexot commented 1 year ago

Nice!

I tried building my with this version for Catalyst and it worked now! FWIW: I had to Clean my Build Folder in Xcode to make it work - otherwise it seemed to used a cached version - causing it to fail with the error in my first post.

I haven't tried the server yet, but being able to build is a good sign!

Thank you @birdofpreyru !!!

birdofpreyru commented 1 year ago

Cool @exotexot , I was sending you an email just as you was replying me here :) So, as the build works for you, I guess it all should work... if it does not, just be sure to check it has server permission for app sandbox, and that the asset path you specify is correct (at least in the example app I figured out bundled assets end-up on different locations inside bundle for normal iOS and Mac Catalyst apps).