sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

`sentry-cocoa` Unknown receiver 'SwiftDescriptor'

Open TrustDec opened this issue 10 months ago • 6 comments

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. image

And when executing npx @sentry/wizard -s -i reactNative, an error is displayed: TypeError: Cannot read properties of null (reading 'token') image

TrustDec avatar Apr 18 '24 08:04 TrustDec

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?

krystofwoldrich avatar Apr 19 '24 11:04 krystofwoldrich

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.

krystofwoldrich avatar Apr 19 '24 13:04 krystofwoldrich

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

pestrige avatar Apr 20 '24 03:04 pestrige

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.

TrustDec avatar Apr 22 '24 03:04 TrustDec

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. image

TrustDec avatar Apr 22 '24 03:04 TrustDec

@TrustDec @pestrige Would you be able to share a minimal reproducible example with us, that would help us debugging the issue.

krystofwoldrich avatar Apr 24 '24 16:04 krystofwoldrich

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?

krystofwoldrich avatar May 10 '24 15:05 krystofwoldrich

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 avatar May 16 '24 08:05 TrustDec

@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

krystofwoldrich avatar May 17 '24 10:05 krystofwoldrich

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 avatar May 19 '24 11:05 TrustDec

@TrustDec Thanks for the replay, I'm happy to hear that this worked for you.

krystofwoldrich avatar May 21 '24 08:05 krystofwoldrich