React Native app crashes when opened on Test Pilot - ios

My React Native app successfully builds and uploads to App Store Connect, but it crashes when I try to open it on TestFlight. Works locally on simulator though.
Error Message
yardenMobile: facebook::react::RCTNativeModule::invoke(unsigned int,
folly::dynamic&&, int)::$_0::operator()() const + 68
Full Error Logs
This error message is indicating an issue in an implementation of the Facebook React Native framework. The error message specifically mentions "RCTNativeModule::invoke", which refers to a function within the framework that's used to call native modules from JavaScript. The message is indicating that there is an issue within this function, in the code located at the "+ 68" offset.
Here is my react-native info:
System:
OS: macOS 13.0
CPU: (8) arm64 Apple M1
Memory: 77.06 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
Watchman: 2021.10.04.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 14.1/14B47b - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
#react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.0 => 0.66.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Anyone know how I can possibly fix this?
WHAT I TRIED
I tried opening the app on TestPilot, but it crashed
WHAT I EXPECTED
I expected the app to open on TestPilot successfully

Related

How to fix fatal error: module 'React' in AST file

Any tips how to fix this? I have tried clean the build folder in Xcode and also manually deleted DerivedData folder, but it does not fix this.
This is what I know so far: It does not crash when developing locally with physical iOS phone or in simulator. TestFlight builds just seems to randomly crash when App is clicked to launch it.
fatal error: module 'React' in AST file '/Users/USERNAME/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/T2AP1DY9NK4/React-3I70GVOCLJ3SS.pcm' (imported by AST file '/Users/USERNAME/Library/Developer/Xcode/DerivedData/mobilePlayer-edutlwanzjvdknakzztrwppfpjhb/Build/Intermediates.noindex/PrecompiledHeaders/mobilePlayer-Bridging-Header-swift_1WSAJVE6367HH-clang_T2AP1DY9NK4.pch') is not defined in any loaded module map file; maybe you need to load '/Users/USERNAME/mobilePlayer/ios/Pods/Headers/Public/React-Core/React/React-Core.modulemap'?
UPDATE:
I can remove this problem, disabling precompiled bridging header option
Go to target > Build Settings > Swift Compiler - General > set Precompiled Bridging Header to No
this work for my project that was ejected (prebuild) from Expo 46
Expo Env Info:
expo-env-info 1.0.5 environment info:
System:
OS: macOS 12.6
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.17.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 8.15.0 - /usr/local/bin/npm
Watchman: 2022.10.10.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
Android SDK:
API Levels: 31, 33
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.0
System Images: android-31 | Google Play Intel x86 Atom_64
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9014738
Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
npmPackages:
babel-preset-expo: ~9.2.0 => 9.2.0
expo: ~46.0.13 => 46.0.15
react: 18.0.0 => 18.0.0
react-dom: 18.0.0 => 18.0.0
react-native: 0.69.6 => 0.69.6
react-native-web: ~0.18.7 => 0.18.9
npmGlobalPackages:
eas-cli: 2.3.0
expo-cli: 6.0.6
Expo Workflow: bare

How can I fix this Mixpanel iOS 30-second background task timeout bug (mixpanel-react-native)?

Problem
My app is occasionally terminating in background after 30 seconds in release mode. The below warning appears after ~30 seconds of the app being sent into the background when running with the Xcode debugger.
2022-04-17 13:53:10.414266-0400 Siro[83233:4914219] [BackgroundTask]
Background Task 297 ("Called by Siro, from
$s8Mixpanel0A8InstanceC29applicationDidEnterBackground33_0CB45E1C8B4A4433813A640264188496LLyy10Foundation12NotificationVF"),
was created over 30 seconds ago. In applications running in the
background, this creates a risk of termination. Remember to call
UIApplication.endBackgroundTask(_:) for your task in a timely manner
to avoid this.
Has anyone else encountered this issue or know of a fix?
Per the error message, the issue seems to be caused by the Mixpanel package, but I find it strange that there is not already an issue report about this issue.
A second strange element is that only ~10% of our users have encountered this issue.
Any ideas?
Environment Information
I do not know if this issue is also occurring on Android
Mixpanel Version: "mixpanel-react-native": "^1.3.10"
Output from npx react-native info:
System:
OS: macOS 12.3.1
CPU: (10) x64 Apple M1 Pro
Memory: 745.50 MB / 32.00 GB
Shell: 5.8 - /bin/zsh Binaries:
Node: 15.13.0 - ~/.nvm/versions/node/v15.13.0/bin/node
Yarn: Not Found
npm: 7.7.6 - ~/.nvm/versions/node/v15.13.0/bin/npm
Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7935034
Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild Languages:
Java: 11.0.15 - /usr/bin/javac npmPackages:
#react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.4 => 0.67.4
I have not solved the root issue, but I created a workaround by preventing Mixpanel from attempting to flush events when app is sent to background.
https://github.com/mixpanel/mixpanel-react-native/pull/135
I'm still not sure what is causing Mixpanel background tasks to sometimes run for 30+ seconds and cause terminations. Perhaps it is due to weak internet connection.

Invariant Violation: Native module cannot be null. [React-Native IOS]

I just upgrade React-native from 0.62.2 to 0.63.4, and get this error. It is not clear from which library or module exactly it gave the error.Many people have encountered an error due to this react-native-push-notification library, but I could not find any error related to this react-native-push-notification library in any log. a library that I do not use in the project and is not installed
[[And I noticed another strange thing. In react native 0.63 and above, the error is that the screen should have changed (So LogBox should be displayed) but as you can see this annoying red black screen is still displayed]]- it's not a big deal but i was just wondering why
i updated everything in the upgrade helper
https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.4
System:
OS: macOS 11.3.1
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU # 2.60GHz
Memory: 134.73 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.2.0 - /usr/local/bin/node
Yarn: Not Found
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /Users/ibrahimyolbir/.rvm/gems/ruby-2.7.1/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6241897
Xcode: 12.5/12E262 - /usr/bin/xcodebuild
Languages:
Java: javac 16 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
#react-native-community/cli: Not Found
react: ^16.13.1 => 16.14.0
react-native: ^0.63.4 => 0.63.4
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
❯ pod deintegrate && pod cache clean --all
❯ pod install
❯ reinstall node_modules
❯ clean project
❯ reopen xcode

How to fix "AVFoundationErrorDomain - code -11800" on IOS rendering stream videos from s3 aws on react-native-video?

Bug
I have an app that uses AWS s3 files url to reproduce videos, at first when i installed react-native-video it's not working and showing the error:
"AVFoundationErrorDomain" code -11800
Ive tried a lot of approaches but unsuccessful. There is A LOT of posts relating the same problem, no one could consistently fix it.
Platform
IOS
Which player are you experiencing the problem on:
iOS
Environment info
System:
OS: macOS 11.2
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU # 2.80GHz
Memory: 538.75 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.5 - ~/.nvm/versions/node/v14.15.5/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 6.14.11 - ~/.nvm/versions/node/v14.15.5/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild
Languages:
Java: 14.0.2 - /Users/caduolivera/.sdkman/candidates/java/current/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
#react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.4 => 0.63.4
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Library version: 5.1.1
Steps To Reproduce
start a fresh rn project
Install react-native-video lib
try any public url video as source: http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4
...
Expected behaviour
The video should play or be playable
Reproducible sample code
<Video
source={{
uri: data.arquivo.nm_url,
}}
onBuffer={(e) => console.log('buffer video', e)}
onError={(e) => console.log('err video', e)}
style={styles.video}
controls
paused={true}
/>
Video sample
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4
----- EDIT -----
I have new information about this.
I tried to replace the video component for a webview using react-native-webview, same error, video loads first screen but does not play.
I also tried to open the same video at safari, pasting link url directly... same error.
Conclusion: That makes me think this issue is not related to this lib. But this does not mean we couldnt work together on tests and research to figure it out, in case some of you still have this issue.
For me the "AVFoundationErrorDomain code -11800" went away when i changed the link from http to https.

React Native: RCTFatal + 668

I've also posted the issue in the React Native github repo, hoping to get some insight into the error.
I've noticed that a not insignificant number of my iOS users experience the fatal error ( RCTFatal + 668 ) in production, resulting in the app crashing. The error occurs about 0.004 times per session, not terrible, but not great either.
There seems to be no correlation between the error and what iOS version the user is running, the number of crashes seems to be directly tied to the number of sessions for each iOS version. What iOS device the user has doesn't seem to correlate with the error either.
I'm unable to reproduce the error in local, staging, or production.
Has anyone else had this error, and what can i do to debug this issue further?
react-native info
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU # 3.10GHz
Memory: 189.93 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.8.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
Android NDK: 20.0.5594570
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
Screenshot from crashes tab in Xcode (App name blurred for privacy)
P.S I'm aware that i'm not running the very latest version of RN. By the time i've upgraded RN, pushed to review, passed review, and got 2 weeks of crash reports there will always be a new version out. If this is known to be fixed in a later RN version, i will happily upgrade.

Resources