Xcode 13 Debug-iphonesimulator/YogaKit/YogaKit.modulemap not found for a brand new project just initialized - xcode

A brand new React Native 0.66 app was created with command below:
npx react-native init myapp
The app was launched successfully with npx react-native run-ios. In Xcode 13, the myapp.xcodeproj is opened to test if the build will pass. To my surprise, build throws the error below:
fatal error: module map file '/Users/macair/Library/Developer/Xcode/DerivedData/xyz_app6-gpxsmunajzbqoualaavtsfpnerep/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found
What is wrong here? I haven't put any code into the app and it is all React Native generated code. Xcode becomes beast by itself even though the React Native app itself runs fine. That's why the app has to be rebuilt.

This seems to be a common problem. The solution works here is just open the myapp.xcworkspace in Xcode instead of myapp.xcodeproj. The build upon workspace went through without any error.

Related

React native IOS build issue

I installed Xcode from AppStore and started the project with react-native init IOS_project command. I had an error after running npm run ios and I opened .../IOS_project/ios/IOS_project.xcodeproj file with Xcode and started the build. Build was failed with the error
fatal error: module map file /Users/artemgorovoi/Library/Developer/Xcode/DerivedData/IOS_project-distoubdwfsutrcrzcjxmzmcwzfx/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap not found
https://i.stack.imgur.com/CWx5U.jpg
https://tinyjpg.com/web/output/rt2x4mgj3tgk8607dy3q0ad6utw2ep1m/94D33C31-0A82-406D-B07F-299E0F621023.png
this happens because in order to run your React Native project through Xcode you must open the .xcworkspace file, in your case IOS_project.xcworkspace, if you only open the .xcodeproj file Xcode won't be able to locate your Pods

How to create React-Native tvos project?

all. I am having a hard time creating a project that can build and run. I can create normal iOS react-native projects without issue, but I don't understand the instructions for the tvos setup. Can someone please explain or simply tell me what lines to enter into the terminal? I am currently creating react native apps using npx (like npx react-native init myproject, npx react-native run-ios etc).
Here are some resources: https://facebook.github.io/react-native/docs/building-for-apple-tv
This one says "The RNTester app supports Apple TV; use the RNTester-tvOS build target to build for tvOS.". I don't know what "RNTester app" is, or how to "use RNTester-tvos build target".
Also, I don't understand anything here: "https://github.com/react-native-community/react-native-tvos"
It's been a while you posted but I had the same issue and finally figured it out:
Depending on your react-native-cli version you can do:
react-native init TestApp --version=react-native#npm:react-native-tvos#latest
or
react-native init TestApp --template=react-native-tvos#latest
TestApp is the name of your App
https://developer.aliyun.com/mirror/npm/package/react-native-tvos

I can run the IOS emulator but project is not present

Unfortunately, I've deleted my react native project with Xcode may it be the .xcworkspace file or .xcodeproj. file
So in order to get my project back with .xcodeproj, I had to rename my project eject and update react native. Having said that I am able to load the emulator but the project is still not present in the emulator. How do I reintegrate it back?
Here is the error that is seen on terminal:
error Failed to build iOS project.
We ran "xcodebuild" command but it exited with error code 65.
To debug build logs further, consider building your app with Xcode.app,
by opening Project.xcodeproj

Can't find React native project on iOS Simulator or Xcode project

I have deleted my project on Xcode may it be .xcworkspace or .xcodeproj.
Because of that, I had to delete IOS and android folders while downgrading, updating and re-upgrading my react version to re-install IOS and android folders.
Thanks to that the emulator is working but unfortunately the project isn't present in the emulator and is still absent with Xcode. One thing to point out is that the simulator only appears when ran in the integrated terminal and nor in general terminal after cd-ing in the project folder.
Can anyone please help re-integrating the project in the emulator and on Xcode, please.
Here is the error when the emulator is running in a general terminal:
Here is the error when the emulator is running in a general terminal:
error Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
Here is the error for building the project within emulator when ran from VS code integrated terminal:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening project.xcodeproj
The process you need to follow is so similar to renaming a react native app. Basically you just need to run react-native upgrade in your root project directory. For further info you can check another question here. The instructions below explains how to create another react native project based on a copied one with a new name.
First copy the directory which your to-be-name-changed application exists. And go to your newly cloned directory.
Change the name at index.ios/android.js file which is given as a parameter to AppRegistry.
Change the name and version accordingly on package.json
Delete /ios and /android folders which are remaining from your older app.
Run $react-native upgrade to generate /ios and /android folders again.
Run $react-native link for any native dependency.
Finally run $react-native run-ios or anything you want.
Courtesy of
https://stackoverflow.com/questions/42506068/how-can-i-regenerate-ios-folder-in-react-native-project

Can't run my React Native project

for some reason I can't run my project with npm run ios. I receive a Entry, ":CFBundleIdentifier", Does Not Exist error.
The funny part is that I can build, and run my project with xcode (debug).
Anyone got any idea why npm run ios throw an error, BUT xcode run smoothly?

Resources