React Native 'yarn run ios' doesn't initialize the project on M1 - react-native

I'm a new user to Mac OS and its system and M1. Whenever I try yarn run ios command it's open normal simulator but not the project that I'm building and it throws me that error and error code 65:
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 dealerApp.xcodeproj.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project dealerApp.xcodeproj -configuration Debug -scheme dealerApp -destination id=0A358C3D-FE10-4872-9913-F927BCC93B29
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Using build description from disk
note: Build preparation complete
PhaseScriptExecution Start\ Packager /Users/bigez/Library/Developer/Xcode/DerivedData/dealerApp-cixnurkshkczahhihjqgcgbblssu/Build/Intermediates.noindex/dealerApp.build/Debug-iphonesimulator/dealerApp.build/Script-FD10A7F022414F080027D42C.sh (in target 'dealerApp' from project 'dealerApp')

I usually run yarn ios.
Also, you might try running the project with Xcode. It should give you a more useful error log so you can find out what the real problem is. Look for the red X icons and see what they say.

Related

Expo won't start the simulator / emulator

I always used to start my Expo project by typing in the terminal expo start and then i (for iOS simulator). The day after iOS 16 got released, Expo started to behave differently. After running expo start it gave me a warning: This command is being executed with the global Expo CLI. Learn more: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421
To use the local CLI instead (recommended in SDK 46 and higher), run:
› npx expo start and after pressing i it threw the following error:
Error running xcrun simctl help: You may need to run sudo xcode-select -s /Applications/Xcode.app and try again.
XDLError: You may need to run sudo xcode-select -s /Applications/Xcode.app and try again.
Unable to verify Xcode and Simulator installation. After this I killed the terminal and in a new one I decided to follow the command it gave me in the warning (after running expo start). I ran npx expo start and then i and it threw me a new error which was:
Unable to run simctl:
Error: xcrun exited with non-zero code: 72
CommandError: xcrun is not configured correctly. Ensure sudo xcode-select --reset works before running this command again., but this time it didn't gave me a warning before pressing i. I also tried to run the commands shown in the errors and re-run the app, but still the same errors were thrown. I updated my OS, XCode and also deleted and cloned the project again so i could re-install dependencies just in case something was wrong with them.
I have attached the GitHub repo link of one of my projects so you can test it as well. It's not just this project, it's all of the projects I use Expo, even the new ones won't start.
If anyone has any idea how to fix this and why this happens, I would really appreciate it :)
Uninstalled and re-installed Expo globally. Updated the simulator to iOS 16 and opened the simulator before running expo start. It works as it did before.

Unable to Run React Native Project after installing react-native-elements on M1 mac

I have created a new project and it was running fine until I installed react-native-elements and I have gone through each step but still it throws error and after searching for solution I found out that it has something to do with M1 but not able to solve it .
This is the error thrown by the system :
debug Command line invocation:
debug /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ReactNativeStarterKit.xcworkspace -configuration Debug -scheme ReactNativeStarterKit -destination id=7E5DA355-488F-44C4-808B-68640668197A
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
debug Prepare build
debug error: The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Workspace Settings.
debug Build Preparation
debug The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Workspace Settings.
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 ReactNativeStarterKit.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ReactNativeStarterKit.xcworkspace -configuration Debug -scheme ReactNativeStarterKit -destination id=7E5DA355-488F-44C4-808B-68640668197A
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Prepare build
error: The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Workspace Settings.
Build Preparation
The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Workspace Settings.
** BUILD FAILED **
The following build commands failed:
Prepare build
(1 failure)

React Native run-android on Apple M1 chip throwing error, "Could not open dsl generic class cache for script"

I am building a mobile application using React-Native. I am now trying to run my application on Android Emulator. First, this is the continuation of this question. I installed the Android Studio and configured the environment as I mentioned in the previous question.
This is what I did to fix the error from previous question.
I changed the line 13 in android/gradle.properties to this:
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
When I run "react-native run-android" command this time, I am getting the error. The error is saying it could not find '/Users/waihein/Desktop/Code/shar-kya-mal-app/node_modules/#react-native-community/cli-platform-android/native_modules.gradle' file.
So I run npm i #react-native-community/cli-platform-android command to install the required package.
The I delete node_modules folder and run "npm install" again. Then I run "react-native run-android". I am getting the following error this time.
* Where:
Settings file '/Users/waihein/Desktop/Code/shar-kya-mal-app/android/settings.gradle' line: 8
* What went wrong:
A problem occurred evaluating settings 'sharkyamalapp'.
> Could not open dsl generic class cache for script '/Users/waihein/Desktop/Code/shar-kya-mal-app/node_modules/#react-native-community/cli-platform-android/native_modules.gradle' (/Users/waihein/.gradle/caches/6.8/scripts/a43tr593rdpk11ispliu0nu14).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61
But the file is there I can see it in the node_modules folder. How can I fix it?

(JS/react-native) How can I solve this error for building react-native app for iOS

Hey guys I'm so new to JS and react-native as well. I was trying to solve this error but I couldn't get it at all! meh
This is what I struggled :
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-ble-plx (to unlink run: "react-native unlink react-native-ble-plx")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
error Could not find the following native modules: RNCAsyncStorage, react-native-ble-plx. Did you forget to run "pod install" ?
info Found Xcode workspace "Sat008.xcworkspace"
info Building (using "xcodebuild -workspace Sat008.xcworkspace -configuration Debug -scheme Sat008 -destination id=61F7DB8A-467A-4027-95C3-B030C17EAA17")
...............
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 Sat008.xcworkspace. Run CLI with --verbose flag for more details.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace Sat008.xcworkspace -configuration Debug -scheme Sat008 -destination id=61F7DB8A-467A-4027-95C3-B030C17EAA17
Prepare build
note: Using legacy build system
=== BUILD TARGET Sat008 OF PROJECT Sat008 WITH CONFIGURATION Debug ===
Check dependencies
The file “Pods-Sat008.debug.xcconfig” couldn’t be opened because there is no such file. (/Users/hyunmincho/Documents/React-Native/SAT_008_DEV/Earthrise-Anders/app/ios/Pods/Target Support Files/Pods-Sat008/Pods-Sat008.debug.xcconfig)
PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/hyunmincho/Library/Developer/Xcode/DerivedData/Sat008-fynygwtjzergqceioiaqjhnwrfbp/Build/Intermediates.noindex/Sat008.build/Debug-iphonesimulator/Sat008.build/Script-D12BA90C2EB97176F46BC0FF.sh
cd /Users/hyunmincho/Documents/React-Native/SAT_008_DEV/Earthrise-Anders/app/ios
/bin/sh -c /Users/hyunmincho/Library/Developer/Xcode/DerivedData/Sat008-fynygwtjzergqceioiaqjhnwrfbp/Build/Intermediates.noindex/Sat008.build/Debug-iphonesimulator/Sat008.build/Script-D12BA90C2EB97176F46BC0FF.sh
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/hyunmincho/Library/Developer/Xcode/DerivedData/Sat008-fynygwtjzergqceioiaqjhnwrfbp/Build/Intermediates.noindex/Sat008.build/Debug-iphonesimulator/Sat008.build/Script-D12BA90C2EB97176F46BC0FF.sh
(1 failure)

error Failed to build iOS project. ran "xcodebuild" command but it exited with error code 65

I am new to react native and I am trying to run react native on IntelliJ. My Android emulator on IntelliJ works perfectly fine however, my iOS emulator doesn't work properly and I am using MacOS X. I'm encountering issues "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 API.xcworkspace. Run CLI with --verbose flag for more details."