getsentry / sentry-react-native

Official Sentry SDK for React-Native
https://sentry.io
MIT License
1.54k stars 323 forks source link

Cannot find protocol declaration for 'SentryMXManagerDelegate' #3800

Closed emre-atilla closed 3 weeks ago

emre-atilla commented 3 weeks ago

OS:

Platform:

SDK:

SDK version: 5.22.1

react-native version: 0.72.7

Are you using Expo?

Are you using sentry.io or on-premise?

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

Configuration:

(@sentry/react-native)

Sentry.init({
  dsn: "https://xxx@yyy.ingest.us.sentry.io/zzz",
  // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
  // We recommend adjusting this value in production.
  tracesSampleRate: 1.0,
  _experiments: {
    // profilesSampleRate is relative to tracesSampleRate.
    // Here, we'll capture profiles for 100% of transactions.
    profilesSampleRate: 1.0,
  },
});

I have the following issue: image

image

I have this issue on iOS it says Cannot find protocol declaration for 'SentryMXManagerDelegate'

[Description]

Steps to reproduce:

krystofwoldrich commented 3 weeks ago

Hi @emre-atilla, thank you for the message, we will take a look at this.

If you are able to create a minimal reproducible example, could you share it with us, it would help us debugging the issue.

Are you using use_frameworks, static, dynamic? Are you using new_architecture?

krystofwoldrich commented 3 weeks ago

@brustolin @philipphofmann This seems specific to sentry-cocoa, any ideas?

emre-atilla commented 3 weeks ago

Hi @krystofwoldrich thank you for responding,

I created a repo for reproduce error again.

What I did :

and its working on android what I expect but on iOS it says cannot find protocol declaration for 'SentryMXManagerDelegate'

here is repo : https://github.com/emre-atilla/ProjectCloneForSentry

krystofwoldrich commented 3 weeks ago

Thank you for the repro. I've reproduced the build issue, we'll investigate it and keep you updated.

krystofwoldrich commented 3 weeks ago

The Sentry pod requires APPLICATION_EXTENSION_API_ONLY to be set to YES, but your podfile sets it to NO for all pods.

You can change your code like this to fix the build.

      # 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

Could you share with us why are you using the APPLICATION_EXTENSION_API_ONLY flag?

Let us know if this help you solve the issue, in case it did not or you have some other question feel free to post it here and we can reopen this.

emre-atilla commented 3 weeks ago

Thank you so much for your help it solves the issue. I don't really remember why I used the APPLICATION_EXTENSION_API_ONLY flag it's a bit old project

julian-gargicevich commented 1 week ago

krystofwoldrich I'm getting this same error after upgrading to 5.22 from 5.19, I'm using expo and the expo plugin

If it's of any help, I have these build properties needed for firebase.

[
      "expo-build-properties",
      {
        ios: {
          useFrameworks: "static",
          deploymentTarget: "15.0",
        },
      },
    ]
FashMuyhee commented 6 days ago
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

@krystofwoldrich i am experiencing similar issue. i used APPLICATION_EXTENSION_API_ONLY flag to NO bcos i to resolve an error

image

using the above snippet solves sentry issue but will end-up throwing the above-screenshot error