I installed it from react-native official site as below.
(node.js and openJDK were installed differently)
Version information
Mac OSX : Mojave 10.14.6
XCode : Version 11.0 (11A420a)
node(nvm) : 10.15
react: 16.9.0
react-native : 0.61.1
react-native-cli : 2.0.1
watchman : 4.9.0
openjdk 11.0.1 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
XCode Preferences
Locations > Command Line Tools : Xcode 11.0 (11A420a)
Components > Simulator : iOS 12.2, iOS 12.1, iOS 11.1, iOS 11.0
Changed the configuration from podfile to platform: ios, '9.0' to platform: ios, '11.0 '.
code execute
react-native init rntest
react-native run-ios
(I don't see an app icon to launch.)
watchman error message
Watchman: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2019-10-03T03:19:20,686: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/myname-state/sock! (No such file or directory)
What should I do to run react-native's initial app?
Do you have watchman installed properly?
What happens when you run watchman --foreground --logfile=/dev/stdout
Please try entering the following command:
chmod 0700 /usr/local/var/run/watchman/yourname-state
Don't forget to change the "yourname" to your user name or whatever you have it there!
Related
Hi am facing an issue while running flutter project in MacBook Air M1 chip Lap. Tried all possibilities couldn't find where is the exact problem.
All basic solutions like flutter clean, flutter pub get, pod deintegrate & install, flutter build ios, flutter run but still same issue. only on iOS simulator not deploying.
Any solution for this. Thanks in advance.
Error
Launching lib/main.dart on iPhone 13 in debug mode...
Running pod install... 5.3s
Running Xcode build...
Xcode build done. 104.1s
Failed to build iOS app
Error output from Xcode build:
↳
objc[25282]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc02c8). One of the two will be used. Which one is undefined.
objc[25282]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x203913180) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc0318). One of the two will be used. Which one is undefined.
** BUILD FAILED **
flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-arm, locale
en-IN)
• Flutter version 2.8.1 at
/Users/macsystem/Documents/developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/macsystem/Library/Android/sdk
• Platform android-32, build-tools 32.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] Connected device (2 available)
• iPhone 13 (mobile) • 05EC9698-3C26-44B9-8DB0-B53C7B6576F3 • ios
• com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
• Chrome (web) • chrome • web-javascript
• Google Chrome 97.0.4692.99
I've done complete clean and install by below steps and it helped me to solve,
Step 1:
flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm ios/Podfile
Step 2:
cd ios
flutter pub get
pod cache clean --all
pod install
or (below for m1 chip incase above command thrown error in pod install)
#1 Install ffi
sudo arch -x86_64 gem install ffi
#2 Re-install dependencies
arch -x86_64 pod install
Step 3:
1. Open ios/Pods/Pods.xcodeproj in Xcode
2. Change the iOS Deployment info from 8.0 to 9.0
Step 4:
From xcode clean / build again / run. Hope this should work. Before please confirm whether all the build settings for iOS configured properly or not.
Note: In those above steps i faced one more issue from Firebase like "firebase import not found". Below added steps how i solved.
Step 1: open ios/Podfile
Check platform :ios, '10.0' is uncommented
Step 2:
add below code at end of Podfile
target 'CustomImageNotifications' do
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
end
Step 3: pod install & open xcode and clean / build.
Hoping this answer may helps.! thanks
I had luck with deleting the Flutter.podspec first and then running flutter clean. I am on a Mac Mini M1.
$ rm ios/Flutter/Flutter.podspec
$ flutter clean
Found here:
https://github.com/flutter/flutter/issues/70895#issuecomment-744734693
I got this resolved by running pod update via compatible mode
% flutter clean
% cd ios
% arch -x86_64 pod update
I had this same problem, however I had an additional error:
Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 15.2.99. (in target 'AppAuth' from project 'Pods')
/Users/zack/Desktop/halseon/Merchant/halseon_merchants/ios/Pods/Pods.xcodeproj: warning: The iOS
Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 15.2.99. (in target 'GoogleSignIn' from project 'Pods')
To fix this:
Open ios/Pods/Pods.xcodeproj in Xcode
Change the iOS Deployment info from 8.0 to 9.0
iOS Deployment info (Image Reference)
In the console, run 'flutter run' and it should run the app in the iOS simulator.
I have been facing this same issue for some time now. the same setup is working nicely in a mac with intel chip. But i have even done a resetup of my system, m1 mac still throws the same error.
I was facing the same error after upgrading from 1.22 to 2.10 on a m1 chip, the project worked normal on android but not in ios, the only thing that work for me was:
Create a new project with the same name and make sure it runs.
Replace the whole ios folder from the older project with the newly created.
flutter clean and pod install on ios folder.
In ios/podfile uncomment platform :ios, '10.0'
Reconfigure if you have any previous settings on ios like firebase, icons...
Flutter run.
I think you could cherry pick the folder/files you need inside ios, but for me it was easiest to reconfigure the whole project.
I'm not sure if this is a bug. But suddenly I cannot build the IOS app anymore for debugging.
Running this command react-native run-ios as I have done many times before started producing this error: zerror 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 devvie.xcworkspace.z
I tried the suggestion and built the app with Xcode.app. I get this error: library not found for -lDoubleConversion I'm not sure what to do about that.
I also tried:
Open Xcode project -> project settings -> Build system to Legacy Build System.
Removing the ios/build folder.
Update Xcode and react-native to the latest version (they were latest already)
Run pod install from the ios directory.
The problem still persists and I don't know where to go from here. Hopefully, someone knows what's going on.
This is the result from react-native info
System:
OS: macOS 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU # 2.20GHz
Memory: 23.47 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
Yarn: 1.17.3 - ~/.yarn/bin/yarn
npm: 6.10.2 - ~/.nvm/versions/node/v8.10.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 29
Build Tools: 29.0.2
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5
npmGlobalPackages:
react-native-cli: 2.0.1
I'm getting 'Lexical or Preprocessor' issues when I try and run on ios either in Xcode or command line. Android builds fine.
The first error is 'React/RCTBridgeModule.h' file not found. I can get rid of this by changing <React/RCTBridgeModule.h> to "RCTBridgeModule.h" but I just end up in an endless stream of the same issue with every module.
I don't believe this is a duplicate question. I've tried all solutions in similar questions and github issues but still can't get it to build;
Unchecked Parallelize Build
Ensured imports are using the updated format e.g. #import <React/RCTBridgeModule.h>
Removed node_modules, .xcworkspace and podfile.lock and reinstalled/updated using both npm and yarn
Tried react-native upgrade
React and Pods project are listed above the project in Edit Scheme > Build
Tried both Xcode 9 & 10 with both Legacy & New build systems
please check the image for paths
react-native info:
Environment:
OS: macOS High Sierra 10.13.6
Node: 8.11.1
Yarn: 1.12.3
npm: 6.5.0
Watchman: 4.9.0
Xcode: Xcode 10.1 Build version 10B61
Android Studio: 3.2 AI-181.5540.7.32.5056338
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.50.4 => 0.50.4
my solution a bit dangerous sometimes!
in old days this happened when I was trying to archive a 0.40+ react-native app for iOS (i found a solution here https://github.com/facebook/react-native/issues/11721#issuecomment-270672904)
i felt like Xcode was trying to build the react-native libraries in parallel with implicit react dependencies before actually building the react library.
so this helped a little !
In Xcode, go to the project scheme (Product -> Scheme -> Manage Scheme -> double click your project).
Click on the 'Build' option at the left pane.
Uncheck 'Parallelize Build' under Build Options.
Then in Targets section, click '+' button then search for 'React'. Select it and click 'Add'.
'React' should now appear under Targets section. Click and drag it to the top so that it will be the first item in the list (before your project).
Clean the project and build.
there are a few more trivial solutions for this scenario that i found are enlisted on another stackQuestion here
After trying on a different Mac and having the same issue I finally solved this with the following:
Uninstall Xcode
Install Xcode 9.0 from Apple Developer downloads
rm -rf node_modules && yarn cache clean && yarn
rm -rf App.xcworkspace Podfile.lock && pod install
react-native start --reset-cache
Run in Xcode
Here are my new react-native info results:
Environment:
OS: macOS 10.14.1
Node: 11.5.0
Yarn: 1.12.3
npm: 6.4.1
Watchman: 4.9.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: 3.2 AI-181.5540.7.32.5056338
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.50.4 => 0.50.4
Whenever I run this command from terminal: flutter build ios in the root of the project for my flutter app, I get back:
Cannot find "xcodebuild". Xcode 9.0 or greater is required to develop for iOS.
Encountered error while building for device.
I have the lastest Xcode (Version 10.0).
Flutter doctor:
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-GB)
• Flutter version 0.8.2 at /Users/h/flutter
• Framework revision 5ab9e70727 (2 weeks ago), 2018-09-07 12:33:05 -0700
• Engine revision 58a1894a1c
• Dart version 2.1.0-dev.3.1.flutter-760a9690c2
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/h/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[!] iOS toolchain - develop for iOS devices
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
• ios-deploy 1.9.2
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 24.2.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] Connected devices (1 available)
• h iPhone • 77afb908fc6c490d3fca62cdde9a74ab4e45b4f0 • ios • iOS 11.4.1
! Doctor found issues in 1 category.
I assume the IOS issue is thrown as I am running Xcode from an external HD
The source of my problem was that Flutter could not find the latest installed version of Xcode.
To fix it, go to Xcode->preferences->locations->set value for command Line tools.
The suggestion from flutter doctor -v is quite clear
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Develope
You could try starting Xcode and agree when it asks to install missing components.
Id suggest you try the dev or master channel where support for Xcode 10 should have landed. Otherwise check this suggestion https://github.com/flutter/flutter/issues/20685#issuecomment-413524718
Run the following commands in your terminal:
1- cd your_project_path
2- sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
3- sudo xcodebuild -license
4- open -a Simulator
5- flutter run
If you Installed Xcode 10 manually via Apple Developer Download Center or Other Sources, then At first, RENAME your Xcode to the Version name you downloaded, like I downloaded the Xcode 10.1 version, so for me the renamed name would be Xcode10.1.app the .app extension is optional as it already has .app extension...
After that, paste this Command on your Terminal,
sudo xcode-select --switch /Applications/Xcode10.1.app/Contents/Developer
Note: the Xcode Version (i.e. Xcode10.1.app ) is Mendatory, if it's there good otherwise, Rename and add it, it's COMPLETELY SAFE and doesn't have any side effects
If you already have Xcode and this error randomly appears, just run these commands, as recommended by Flutter Doctor:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
Install Xcode (get it from https://developer.apple.com/xcode/) if you don't have it yet.
Accept the Terms and Conditions.
Ensure Xcode app is in the /Applications directory (NOT /Users/{user}/Applications).
Point xcode-select to the Xcode app Developer directory using the following command:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Reference: https://github.com/flutter/flutter/issues/6308
According to #matt-hamman
If your Xcode was updated to v14.1 and your Mac is running macOS 12.6, this will happen because the macOS SDK that xcodebuild is looking for happens to be MacOSX12.3.sdk while your OS has already been updated to 12.6.
Running xcode-select -p returns /Applications/Xcode.app/Contents/Developer, which is what Xcode 14 configured automatically. (Changing this via sudo xcode-select --switch /Library/Developer/CommandLineTools fixes git, but breaks other things in subtle ways (like some CocoaPods commands).)
To fix this issue, simply run:
sudo cp -R /Library/Developer/CommandLineTools/SDKs/MacOSX12* /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
Further details can be gleaned from the original answer here
To fix it, go to Xcode->preferences->locations->set value for command Line tools.
I'm trying to add iOS as a platform for my app but when I run:
ionic platform iOS
I get the error "Cordova can only run in Xcode version 4.6 or greater." I have Xcode 5.1.1 installed which comes with the command-line tools. I have tried:
sudo xcode-select --switch /Applications/Xcode.app
but when I run:
xcodebuild -version
it says I have Xcode version 4.4 installed.
I've been stuck on this for a while now so any help is appreciated. Thanks.