[help needed] Problems running the app locally
serchavalos opened this issue · comments
Hello!
I tried to run the app locally but couldn't due to the following errors:
⠇ Building the app.......Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at stableHash (/Users/sergio/dev/skolplattformen/node_modules/metro-cache/src/stableHash.js:19:8)
at Object.getCacheKey (/Users/sergio/dev/skolplattformen/node_modules/metro-transform-worker/src/index.js:593:7)
at getTransformCacheKey (/Users/sergio/dev/skolplattformen/node_modules/metro/src/DeltaBundler/getTransformCacheKey.js:24:19)
at new Transformer (/Users/sergio/dev/skolplattformen/node_modules/metro/src/DeltaBundler/Transformer.js:48:9)
at /Users/sergio/dev/skolplattformen/node_modules/metro/src/Bundler.js:22:29
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
...
** BUILD FAILED **
The following build commands failed:
CompileC /Users/sergio/Library/Developer/Xcode/DerivedData/app-fzhernkxeiuybtcnzuuzrfpckcgv/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Yoga.build/Objects-normal/arm64/Yoga.o /Users/sergio/dev/skolplattformen/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Yoga' from project 'Pods')
(1 failure)
I looked up for this error online and found this suggestion, but after applying it, I got the following error:
> yarn run ios
yarn run v1.22.19
$ nx run-ios
> NX ERROR Initiated Worker with invalid NODE_OPTIONS env variable: --openssl-legacy-provider is not allowed in NODE_OPTIONS
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I'm running on this platform
macOS: 14.1 (23B74)
Xcode: 15.0.1
Node: 18.18.2
Yarn: 1.22.19
Btw, after it fails the first time, I get this other error if I try to run the command yarn run ios
again
➜ skolplattformen git:(main) ✗ yarn run ios
yarn run v1.22.19
$ nx run-ios
> nx run skolplattformen-app:run-ios
ENOTDIR: not a directory, rmdir '/Users/sergio/dev/skolplattformen/apps/skolplattformen-app/node_modules'
———————————————————————————————————————————————
> NX ERROR Running target "skolplattformen-app:run-ios" failed
Failed tasks:
- skolplattformen-app:run-ios
Hint: run the command with --verbose for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Is there another command I should be running?
Hi, I'm not very good at all the differences with the tooling, but we are building with Node 16.19.1 and Xcode 14.1.
I guess the problem may be there.
@kajetan-kazimierczak Thanks for the reply! Are you running macOS? And if so, have you updated to Sonoma? I'm asking because I tried to downgrade to Xcode 14.3.1 but the new operating system won't allow me to execute it due to incompatibilities
I finally managed to get it up and running.
For anyone looking for answer (or my future self suffering from amnesia), these are the steps I followed:
- Downgraded to Node 16 as previously suggested using NVM.
- Followed the setup instructions on README.md :
yarn && yarn run ios
- The first error I encountered related to
Yoga.cpp
was fixed by following this suggestion - For the second error, related to
unary_function
I followed this tip
After that, I managed to successfully build the app but it wouldn't open the simulator after executing yarn run ios
due to this other error:
success Successfully built the app
2023-11-03 13:50:54.337 xcodebuild[22691:2760548] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition
info Installing "/Users/sergio/Library/Developer/Xcode/DerivedData/app-fzhernkxeiuybtcnzuuzrfpckcgv/Build/Products/Debug-iphonesimulator/app.app"
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405):
To open the simulator
- I went to XCode (v15.0.1 btw)
- opened the file
skolplattformen/apps/skolplattformen-app/ios/app.xcworkspace
(btw, this is the first time I'm using XCode or even attempting to develop a mobile app) - and, chose from the XCode's menu Product > Destination > iPhone SE (or whichever is available)
I noticed the script running in the terminal listened to the changes coming from XCode and also from the Visual Code editor. So I confirmed everything was working by updating a string in the app and seeing the change reflected in the simulator
Thanks for the info.