sentry-react-native
sentry-react-native copied to clipboard
`sentry-cocoa` Unknown receiver 'SwiftDescriptor'
OS:
- [x] MacOS
Platform:
- [x] iOS
- [ ] Android
SDK:
- [x]
@sentry/react-native
(>= 1.0.0) - [ ]
react-native-sentry
(<= 0.43.2)
SDK version: 5.22.0
react-native
version: 0.73.6
Are you using Expo?
- [ ] Yes
- [x] No
Are you using sentry.io or on-premise?
- [x] sentry.io (SaaS)
- [ ] on-premise
I have the following issue:
iOS cannot be built. After upgrading @sentry/react-native 5.20 to 5.22, it cannot be built and can't be downgraded.
And when executing npx @sentry/wizard -s -i reactNative
, an error is displayed:
TypeError: Cannot read properties of null (reading 'token')
Hi @TrustDec, thank you for the message, are you using statically or dynamically linked frameworks?
Have you clean the build and reinstalled pods after upgrading to 5.22.0?
This error is coming from sentry-cocoa
.
- https://github.com/getsentry/sentry-cocoa/issues/3850
We will keep this issue open until resolved in RN. But expect most of the updates in the linked issue.
The same issue after upgrading to @sentry/[email protected]. The solution for me is downgrade to v5.20.0:
yarn add @sentry/[email protected]
cd ios && pod update Sentry
Hi @TrustDec, thank you for the message, are you using statically or dynamically linked frameworks?
Have you clean the build and reinstalled pods after upgrading to 5.22.0?
Yes, after the upgrade, the project was cleaned up and rebuilt like this.
The same issue after upgrading to @sentry/[email protected]. The solution for me is downgrade to v5.20.0:
yarn add @sentry/[email protected] cd ios && pod update Sentry
I tried to solve this problem in this way.The only way I can solve it now is to uninstall Sentry and delete the Sentry-related code.
@TrustDec @pestrige Would you be able to share a minimal reproducible example with us, that would help us debugging the issue.
Hi @TrustDec and @pestrige,
this issue might be relater to APPLICATION_EXTENSION_API_ONLY=NO
, Sentry requires this option to be set to YES, this is how the Sentry Pod is setup by default. But it's possible that this configuration was overwritten in your case.
Can you verify APPLICATION_EXTENSION_API_ONLY=YES
for the Sentry Pod in your application, or share your Pod file with us?
Hi @TrustDec and @pestrige, this issue might be relater to
APPLICATION_EXTENSION_API_ONLY=NO
, Sentry requires this option to be set to YES, this is how the Sentry Pod is setup by default. But it's possible that this configuration was overwritten in your case.Can you verify
APPLICATION_EXTENSION_API_ONLY=YES
for the Sentry Pod in your application, or share your Pod file with us?
OK, changing APPLICATION_EXTENSION_API_ONLY to YES will cause other mistakes. I'm just curious why suddenly need to set APPLICATION_EXTENSION_API_ONLY to YES? There was no any problem before.
If I don't change it to YES, Sentry will not be available? For some reasons, I can't set it to YES.
post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
# disable code signing for pods
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end
@TrustDec Thanks for the response, to avoid the issue, you can change this only for Sentry, or vice versa only for other Libraries.
Yes, APPLICATION_EXTENSION_API_ONLY
has to be YES
in order for Sentry to build.
This example will not change the default value of APPLICATION_EXTENSION_API_ONLY
for Sentry.
post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)
installer.pods_project.targets.each do |target|
# Check if the pod is not Sentry
unless target.name == 'Sentry'
# Iterate through each build configuration
target.build_configurations.each do |config|
# Modify the build settings
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
end
end
target.build_configurations.each do |config|
# disable code signing for pods
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end
Thank you for your reply. Add the following code and work for me.
if target.name == 'Sentry'
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'YES'
else
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
end
@TrustDec Thanks for the replay, I'm happy to hear that this worked for you.