Sentry on React Native: Building for iOS breaks with "property 'options' not found on object of type 'PrivateSentrySDKOnly'" - ios

I am using CircleCI to build for iOS (and Android) and recently, the iOS build fails with these error messages:
Compiling RNSentry.m
❌ /Users/distiller/project/node_modules/#sentry/react-native/ios/RNSentry.m:107:79: property 'options' not found on object of type 'PrivateSentrySDKOnly'
if (appIsActive && !sentHybridSdkDidBecomeActive && (PrivateSentrySDKOnly.options.enableAutoSessionTracking || PrivateSentrySDKOnly.options.enableOutOfMemoryTracking)) {
^
❌ /Users/distiller/project/node_modules/#sentry/react-native/ios/RNSentry.m:107:137: property 'options' not found on object of type 'PrivateSentrySDKOnly'
if (appIsActive && !sentHybridSdkDidBecomeActive && (PrivateSentrySDKOnly.options.enableAutoSessionTracking || PrivateSentrySDKOnly.options.enableOutOfMemoryTracking)) {
^
❌ /Users/distiller/project/node_modules/#sentry/react-native/ios/RNSentry.m:155:39: property 'getSdkName' not found on object of type 'PrivateSentrySDKOnly'
#"name": PrivateSentrySDKOnly.getSdkName,
^
❌ /Users/distiller/project/node_modules/#sentry/react-native/ios/RNSentry.m:195:34: property 'options' not found on object of type 'PrivateSentrySDKOnly'
if (PrivateSentrySDKOnly.options.debug
It has once worked to build for iOS, and I think this has something to do with the version of Sentry; I think I tried to update the Sentry version to 4.9.0, only to find that 4.9.0 has some serious issues (I think). I am not smart enough to dechiffer exactly what the conclusions here are, but I think it relates:
https://github.com/getsentry/sentry-cocoa/issues/1665
https://github.com/getsentry/sentry-react-native/issues/2530
(I was looking for another URL that related, but cant find now)
Android works to build with the configs and whatnot, but iOS fails. I am not sure what do to do resolve this, and I would like some input =)
the package.json has Sentry 4.8.0:
"dependencies": {
"#react-native-async-storage/async-storage": "^1.17.4",
"#react-native-community/cli-platform-android": "^6.3.0",
"#sentry/react-native": "4.8.0",
"#turf/distance": "^6.0.1",
"axios": "^1.1.1",
"dotenv": "^16.0.0",
"eventing-bus": "^2.0.1",
"jetifier": "^2.0.0",
"lodash": "^4.17.15",
"moment": "^2.29.3",
"moment-timezone": "^0.5.34",
"patch-package": "^6.4.7",
"react": "17.0.2",
"react-native": "0.67.4",
Here is the rest of my config/setup:
PS C:\Github\alfaonlinev3> npx react-native doctor
Common
✓ Node.js
✓ yarn
Android
✓ JDK
✖ Android Studio - Required for building and installing your app on Android
✓ Android SDK - Required for building and installing your app on Android
✓ ANDROID_HOME
Errors: 1
Warnings: 0
Note: I have Android Studio installed, and it is working for Android native project. No idea why doctor complains or how to resolve it, other than downloading another copy of Android studio?
envinfo:
Visual Studio code: 1.73.1
System:
OS: Windows 10 10.0.19044
CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
Memory: 5.01 GB / 31.95 GB
Binaries:
Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD
Managers:
pip2: 19.2.3 - C:\Python27\Scripts\pip2.EXE
pip3: 21.1.1 - C:\Python39\Scripts\pip3.EXE
Utilities:
Git: 2.34.1.
SDKs:
Android SDK:
API Levels: 28, 29, 30, 31, 33
Build Tools: 28.0.3, 29.0.0, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
IDEs:
VSCode: 1.73.1 - C:\Program Files\Microsoft VS Code\bin\code.CMD
Visual Studio: 17.3.32519.111 (Visual Studio Community 2022), 16.11.32106.194 (Visual Studio Community 2019)
Languages:
Java: 19.0.1
Python: 3.9.5
Databases:
SQLite: 3.32.2 - C:\Users\wagge\AppData\Local\Android\Sdk\platform-tools\sqlite3.EXE
Browsers:
Chrome: 107.0.5304.121
Edge: Spartan (44.19041.1266.0), Chromium (107.0.1418.56)
Internet Explorer: 11.0.19041.1566
IDEs:
Android Studio: Not Found
Visual Studio: 17.3.32519.111 (Visual Studio Community 2022), 16.11.32106.194 (Visual Studio Community 2019)
Languages:
Java: 19.0.1
npmPackages:
#react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.4 => 0.67.4
react-native-windows: Not Found
npmGlobalPackages:
*react-native*: Not Found
UPDATE
I ran npm-update, it suggested updating sentry to 4.10.1. After that was done, I see this change in package.json:
also yarn.lock
but still, the builds fails with the same error.
UPDATE 2
I check podfile.* and I see stuff like:
podfile.lock:
- RNSentry (3.4.2):
- React-Core
- Sentry (= 7.11.0)
- RNSnackbar (2.4.0):
- React-Core
- RNSVG (9.13.6):
- React
- Sentry (7.11.0):
- Sentry/Core (= 7.11.0)
- Sentry/Core (7.11.0)
The file podfile does not contain "sentry" at all.

Looks like it is your problem:
https://github.com/getsentry/sentry-react-native/pull/2599/files
Try to upgrade react native sentry to 4.10.1

From your podfile.lock it looks like you have an old version of the RNSentry pod installed.
- RNSentry (3.4.2):
Try to run the following:
cd ios
pod update RNSentry
The RNSentry must be the same version as #sentry/react-native. So in your case it should've been 4.10.1.

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

No member named 'cancelButtonTintColor' in 'JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions'

Description
How to fix this error. I have created simple project with latest version and when try to build the project via Xcode it generate error?
Version
0.67.3
Output of npx react-native info
OS: macOS 11.5.2
CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU # 2.80GHz
Memory: 83.30 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.2 - /usr/local/opt/node#14/bin/node
Yarn: 1.22.15 - /usr/local/bin/yarn
npm: 6.14.15 - /usr/local/opt/node#14/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7583922
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 15.0.2 - /usr/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.3 => 0.67.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Please init new react native project with command and try to build the project in the xcode after pod install
after each time pod-install => clean build XCode > Product > Clean Build Folder(command + shift + k) => rebuild, that work.
The problem is with rn > 0.67.0, pod-cache pointing to the old file.
https://github.com/facebook/react-native/commit/01856633a1d42ed3b26e7cc93a007d7948e1f76e
You could create that into the library source or you could avoid it and use the same UIColor option just above it.
I removed:
( [RCTConvert UIColor:options.cancelButtonTintColor() ? #( options.cancelButtonTintColor()) : nil];* )
and replace it with:
( *[RCTConvert UIColor:options.tintColor() ? #(options.tintColor()) : nil]; )
my line now looks like:
UIColor *cancelButtonTintColor =
[RCTConvert UIColor:options.tintColor() ? #(*options.tintColor()) : nil];
it is not the better way, but you can do it in the meanwhile this is fixed.
clean build folder after pod install worked for me
in top navigation bar click on Production ---> Clean Build Folder

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

CocoaPods could not find compatible versions for pod "UMCore"

🐛 Bug Report
Summary of Issue
When running pod install after following the steps to install unimodules by changing AppDelegate.h, AppDelegate.m and Podfile getting an error.
Environment - output of expo diagnostics & the platform(s) you're targeting
Expo CLI 4.0.13 environment info:
System:
OS: macOS 11.1
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.0 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 26, 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.3
System Images: android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 12.3/12C33 - /usr/bin/xcodebuild
npmPackages:
react: 16.13.1 => 16.13.1
react-dom: ^16.13.0 => 16.13.0
react-native: 0.63.4 => 0.63.4
npmGlobalPackages:
expo-cli: 4.0.13
Expo Workflow: bare
Reproducible Demo
The error is as follows:
[!] CocoaPods could not find compatible versions for pod "UMCore":
In Podfile:
UMCore (from `../node_modules/#unimodules/core/ios`)
UMPermissionsInterface (from `../node_modules/unimodules-permissions-interface/ios`) was resolved to 5.4.0, which depends on
UMCore
Specs satisfying the `UMCore (from `../node_modules/#unimodules/core/ios`), UMCore` dependency were found, but they required a higher minimum deployment target.
Steps to Reproduce
npm install --save react-native-unimodules
Follow steps here: https://docs.expo.io/bare/installing-unimodules/
pod install in the ios directory
Expected Behavior vs Actual Behavior
Expected behavior is that pod install works without any errors, but instead getting the error shown in the Reproducible Demo section.
This issue is coming because development target of library UMCore pod file is greater than the development target of your project. To solve this find pod file of the UMCore library and check the value of s.ios.deployment_target. If the value development target is greater than your project development target then set the same target value for your project development target.
To change the your project development target open project in xcode. From xcode general tab > Deployment Info. Here you can change.

Dart Webdev Dev Compiler not running since upgrade to 2.3.2

Since I have moved from Dart 2.1.0 to 2.3.2 "webdev serve" runs successfully, but when I run the project, it gets a 404 on "main.digests". I updated my dev dependencies of build_runner, build_web_compiler, and webdev to the latest versions, and the issue still occurs.
It still builds in dart2js fine. Even if it is "webdev serve --release" it works.
Here is a copy of my pubspec:
environment:
sdk: '>=2.3.2 <3.0.0'
dependencies:
analyzer: any
intl: any
stagexl: 1.4.0+2
stagexl_particle: ^0.4.0
uuid: ^1.0.3
dependency_overrides:
stagexl:
git: https://github.com/AndrewLugg/StageXL.git
dev_dependencies:
build_runner: ^1.6.1
build_web_compilers: ^2.1.1
webdev: ^2.2.0
and here is my build.yaml
targets:
$default:
builders:
build_web_compilers|entrypoint:
generate_for:
- web/app/**.dart
options:
dart2js_args:
- --fast-startup
- --no-source-maps
- --show-package-warnings
- --trust-primitives
- --trust-type-annotations
- --omit-implicit-checks
Here is a copy of the error:
http://localhost:53322/webdev/src/serve/injected/client.js:2693
GET http://localhost:53322/app/main.digests 404 (Not Found)
Uncaught Instance of 'minified:b0' client.js:367
Any help would be greatly appreciated.
This problem disappeared once we upgraded to Dart SDK 2.5.2, there was no real explanation to why this happened.

Resources