Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS - Events are not recorded #4432

Open
uypao opened this issue Jan 9, 2025 · 6 comments
Open

iOS - Events are not recorded #4432

uypao opened this issue Jan 9, 2025 · 6 comments

Comments

@uypao
Copy link

uypao commented Jan 9, 2025

What React Native libraries do you use?

React Navigation

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.5.0

How does your development environment look like?

System:
  OS: macOS 14.3.1
  CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  Memory: 1.09 GB / 16.00 GB
  Shell:
    version: 3.2.57
    path: /bin/bash
Binaries:
  Node:
    version: 20.8.1
    path: ~/.nvm/versions/node/v20.8.1/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 10.1.0
    path: ~/.nvm/versions/node/v20.8.1/bin/npm
  Watchman:
    version: 2024.05.06.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 28.0.3
      - 29.0.0
      - 29.0.2
      - 29.0.3
      - 30.0.1
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-34 | Android TV Intel x86 Atom
      - android-34 | Google TV Intel x86 Atom
      - android-34 | Google APIs Intel x86_64 Atom
      - android-34 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11668458
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.7
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: ^18.2.0
  react-native:
    installed: 0.74.0
    wanted: 0.74.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Sentry.init()

const navigationIntegration = Sentry.reactNavigationIntegration({
	enableTimeToInitialDisplay: true,
});
Sentry.init({
	release: SENTRY_RELEASE,
	dist: SENTRY_DIST,
	dsn: "https://###@###.ingest.us.sentry.io/###",
	environment: __DEV__ ? 'development' : 'production',
	// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
	// We recommend adjusting this value in production.
	tracesSampleRate: 1,
	integrations: [
		Sentry.mobileReplayIntegration({
			maskAllText: false,
			maskAllImages: false,
			maskAllVectors: false,
		}),
		navigationIntegration
	],
	maxBreadcrumbs: 250,
	sendDefaultPii: true,
	attachStacktrace: true,
	replaysSessionSampleRate: 1,
	replaysOnErrorSampleRate: 1.0,
	autoInitializeNativeSdk: true,
	enableUserInteractionTracing: true,
	debug: __DEV__
});	

Steps to Reproduce

  1. Run the app in iOS
  2. Crash the app using Sentry.captureException(new Error('test error'))
  3. The app crashes but no record in the dashboard.

Expected Result

Crash report is added in the dashboard

Actual Result

No crash recorded

Here is the logs when I invoke Sentry.captureException(new Error('test error'))

LOG  Sentry Logger [log]: [TouchEvents] Touch event within element: Text
LOG  Sentry Logger [log]: [UserInteraction] User Interaction Tracing can not create transaction with undefined elementId.
DEBUG  Sentry Logger [debug]: [Sentry] MobileReplay not sampled for event 9f3b36b9cef140dfa829163e7fd0a06a.
@krystofwoldrich
Copy link
Member

Hi @uypao,
thank you for the details.

The application should not crash after calling Sentry.captureException(new Error('test error')). This code should only report the test error to Sentry. But the application should keep running.

To debug this further could you share with us logs from the crash? Or minimal reproducible example?

Does a React Native Red Box appears before the crash? Or if you are using Xcode, could you share with us stack trace of the crash?

@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK Jan 10, 2025
@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Jan 10, 2025
@uypao
Copy link
Author

uypao commented Jan 10, 2025

@krystofwoldrich Sorry I was using different types of error to log which would work. I was using Sentry.nativeCrash() to test the crash the app. Both Sentry.captureException(new Error('test error')) and Sentry.nativeCrash() did not log anything in the dashboard.

Here are the logs:

LOG Sentry Logger [log]: [TouchEvents] Touch event within element: Text LOG Sentry Logger [log]: [UserInteraction] User Interaction Tracing can not create transaction with undefined elementId. DEBUG Sentry Logger [debug]: [Sentry] MobileReplay assign already recording replay a96e1cdce17b4a2f8c442d21dedc92d6 for event 8e72db7e47964c098940eb754c334c1b.

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 10, 2025
@uypao
Copy link
Author

uypao commented Jan 10, 2025

The react native red box does not appear before the crash

@krystofwoldrich
Copy link
Member

For Sentry.nativeCrash() please test this functionality in Release build of the application, note that the crash is sent on the next application start.


For Sentry.captureException(new Error('test error')) the issue should appear in Sentry within few seconds.

If no events are no being received check that you simulator/phone is able to access the DSN. You can for example try to open the DSN in your simulator's/phone's browser, the server should respond with 404.

@uypao
Copy link
Author

uypao commented Jan 14, 2025

DSN is accessible on my device.

Image

Not sure what else to look for. It stopped working after upgrading from 5.5.0 to 6.5.0

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 14, 2025
@krystofwoldrich
Copy link
Member

Thank you for confirmation,
since the issue is on iOS can you share with us the Simulator/Device console (from app start till calling captureException in JS), so we can investigate if the issue possibly in the native code?

@getsantry getsantry bot moved this from Waiting for: Product Owner to Waiting for: Community in GitHub Issues with 👀 3 Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Community
Status: Needs More Information
Development

No branches or pull requests

2 participants