React native suddenly cannot build the ios version anymore - ios

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

Related

React Native app crashes on launch in iOS simulator with assertion failed: 18G95 16G73

When running my React Native app (0.61.2) through the terminal or Xcode, it will crash on launch after bundle has fully loaded.
The only clue is from react-native log-ios to get a glimpse of why it's crashing.
<Error>: assertion failed: 18G95 16G73: libxpc.dylib + 80528 [5846A329-63C0-3B4F-BC91-F30AF4CA6E30]: 0x7d
Unknown[5116] <Error>:
The most Xcode gives me before the crash of the app on launch is:
2019-10-29 17:33:41.028898+0800 my_app[6277:117010] [AppCenterCrashes] WARNING: -[MSCrashes configureCrashReporterWithUncaughtExceptionHandlerEnabled:]/656 Detecting crashes is NOT enabled due to running the app with a debugger attached.
2019-10-29 17:33:41.035744+0800 my_app[6277:117010] [AppCenter] WARNING: -[MSAuthTokenContext authTokenHistory]/210 Failed to retrieve history state or none was found.
2019-10-29 17:33:41.035901+0800 my_app[6277:117010] [AppCenter] WARNING: -[MSAuthTokenContext setAuthTokenHistory:]/225 Failed to save new history state.
In the terminal, it is simply being started with react-native run-ios. This is an ejected app.
This works in the Android emulator, but it crashes on iOS.
To be clear, creating a build for deployment works as well with this exact codebase (we utilize App Center for building and deployment). Only difference is the node version is 8 on App Center whereas locally it's 12.
What I've tried so far is:
Removing node_modules and pods folder completely
Clearing haste cache with rm -rf /tmp/haste-map-react-native-package-*
Reset metro bundler cache rm -rf /tmp/metro-bundler-cache-*
System setup is as follows:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU # 2.40GHz
Memory: 40.67 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.6.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5692245
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
npmGlobalPackages:
react-native-cli: 2.0.1
To note, another React Native project albeit at version 0.60 has no issues running in the same simulator in Xcode.
Expected output
The app should run without crashing in the iOS simulator when running the command react-native run-ios. At the very least the crash should have an identifiable stacktrace but right now I can't even obtain that.
Are there any other steps I can try to further identify where the issue originates from?
If there is a way to to enable Debug JS Remotely before even starting the app to maybe capture a glimpse of the issue in the debugger would also be a great help but this does not seem to be possible.

How to used Xcode task in Azure Pipelines?

I have a Xamarin CI process set up in Azure Pipelines.
Due to my recent changes, I need to use iOS 13.0 to compile my code.
In my azure-pipelines.yml I have the following code:
- task: Xcode#5
inputs:
sdk: "iphoneos13.1"
xcodeVersion: "/Applications/Xcode_11.1.app"
actions: 'build'
Sidenote: I am using poolvmImage: 'macos-latest'
I took the Xcode task from this documentation.
On GitHub it looks like ALL Mac machines have iOS 13 SDK installed.
...but when I run
- task: CmdLine#2
inputs:
script: 'xcodebuild -showsdks'
from my yml file it is displaying the following output:
Script contents:
xcodebuild -showsdks
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /Users/vsts/agent/2.158.0/work/_temp/11b07ed3-faf4-4917-a9ea-3c1dc52aa96f.sh
iOS SDKs:
iOS 12.4 -sdk iphoneos12.4
iOS Simulator SDKs:
Simulator - iOS 12.4 -sdk iphonesimulator12.4
macOS SDKs:
macOS 10.14 -sdk macosx10.14
tvOS SDKs:
tvOS 12.4 -sdk appletvos12.4
tvOS Simulator SDKs:
Simulator - tvOS 12.4 -sdk appletvsimulator12.4
watchOS SDKs:
watchOS 5.3 -sdk watchos5.3
watchOS Simulator SDKs:
Simulator - watchOS 5.3 -sdk watchsimulator5.3
The question is:
how to force Azure Pipelines to use iOS 13 and Xcode 11 to build my app?
The issue you are facing should be due to our image deployment delays. For my region(East US 2),if I execute the command
xcodebuild -showsdks
xcodebuild -version
And below is the iOS and Xcode info about the Hosted macOS 10.14 on my region.
According to the info you shared, seems the hosted agent used by the region where your org is located have not been deployed with these latest upgrade. So, even with command to pick up iOS 13 or other SDK still could not succeed because of none SDK exists.
Most time, the deployment process would has some delay because of different regions. Please pay some times to waiting for the deployment job finished. It will be fully deployed to all regions in the latest two weeks.
If you are hurry for building and deploy your app with these SDKs, here has a temporary work around can for you use: install the private macOS pre-release agent by reference to this link:
Pre-release agent 2.159.1.

Can't find app icon in react-native ios build

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!

React Native Xcode header files not being found! RCTBridgeModule

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

iOS build failed after adding cordova fabric plugin

I added fabric plugin in my ionic 3 app. It's working in android but for iOS it has a problem.
When running ionic build ios --prod or ionic build ios I am getting following error:
/Users/abc/Library/Developer/Xcode/DerivedData/MyApp-
fgpvbdhjneqliicfyhoiuvrrhbfs/Build/Intermediates/MyApp.build/Debug-
iphonesimulator/MyApp.build/Script-FE794D9BFDB14C30B9E39200.sh: line 2:
/Users/abc/Desktop/NS: No such file or directory
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Fabric.io:\ Crashlytics
/Users/abc/Library/Developer/Xcode/DerivedData/MyApp-
fgpvbdhjneqliicfyhoiuvrrhbfs/Build/Intermediates/MyApp.build/Debug-
iphonesimulator/MyApp.build/Script-FE794D9BFDB14C30B9E39200.sh
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -
xcconfig,/Users/abc/Desktop/NS H iOS 2/platforms/ios/cordova/build-
debug.xcconfig,-workspace,MyApp.xcworkspace,-scheme,MyApp,-
configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS
Simulator,name=iPhone
5s,build,CONFIGURATION_BUILD_DIR=/Users/abc/Desktop/NS H iOS
2/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/abc/Desktop/NS H
iOS 2/platforms/ios/build/sharedpch
Ionic info:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.10.2
Xcode version: Xcode 8.3.1 Build version 8E1000a
Please help.
Have you installed Fabric with CocoaPods? Here is the doc: https://fabric.io/kits/ios/crashlytics/install (Select Objective C).
This issue seems to be similar to this one that has been solved: Integrate Fabric/Crashlytics via CocoaPods
I hope It helps you.

Resources