Sentry-dart: Swift and Objective-C errors are not getting reported

Created on 24 Jan 2021  Â·  5Comments  Â·  Source: getsentry/sentry-dart

_Platform:_

  • [ ] Dart
  • [x] Flutter Android or iOS
  • [ ] Flutter Web

_IDE:_

  • [x] VSCode
  • [ ] IntelliJ/AS
  • [x] XCode
  • [ ] Other, which one?

_split-debug-info and obfuscate (Flutter Android or iOS) or CanvasKit (Flutter Web):_

  • [ ] Enabled
  • [x] Disabled

_Platform installed with:_

  • [x] pub.dev
  • [ ] GitHub

Output of the command flutter doctor -v below:

[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-arm, locale en-IL)
• Flutter version 1.22.5 at /Users/ariel/Development/flutter
• Framework revision 7891006299 (6 weeks ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4

[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.1

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1

[✓] Connected device (1 available)
• iPhone 12 Pro Max (mobile) • E1AC5B91-EED9-4196-AE10-E1A7D9DEA4C4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)

! Doctor found issues in 2 categories.

The version of the SDK (See pubspec.lock):
4.x.x


I have the following issue:

I'm using sentry_flutter: ^4.0.3, and I run the example code. All dart-related errors are working and bugs are being sent to sentry when I click those buttons. But when I click all objective-c and swift error invocation buttons, I can see in the console that there is an error, but I can't see it on sentry. I tried on release mode as well.

Steps to reproduce:

  • Just run the example code at example/lib/main.dart

Actual result:

  • Reports are not being sent when clicking the objective-c and swift error messages buttons.

Expected result:

  • Should get a sentry report when invoking those errors
question

Most helpful comment

As per https://flutter.dev/docs/testing/build-modes
release mode isn't supported for the simulator. So I am curious how did you do that?

All 5 comments

Hey @HTMHell did you try on release mode?

Hey @HTMHell did you try on release mode?

Yes, I did. (on a simulator tho if it makes a difference)

As per https://flutter.dev/docs/testing/build-modes
release mode isn't supported for the simulator. So I am curious how did you do that?

I just tested it and it worked, I have a hunch though.

@HTMHell have you tried running the example directly from this repo? which is pretty much the same as https://pub.dev/packages/sentry_flutter/example

the difference is, the pub.dev example doesn't have the full examples with the message channel implementations, so when the example calls the Android or iOS code (via message channel), nothing is being done, cus you only copied the Dart bits.

your iOS code should do something like this: https://github.com/getsentry/sentry-dart/blob/main/flutter/example/ios/Runner/AppDelegate.swift

Please confirm if that's the case, thanks :)

As per https://flutter.dev/docs/testing/build-modes
release mode isn't supported for the simulator. So I am curious how did you do that?

I thought it was release mode but in fact it was debug mode.
Thank you guys, and sorry for the trouble.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vppysk picture vppysk  Â·  3Comments

bruno-garcia picture bruno-garcia  Â·  5Comments

babulpatel1309 picture babulpatel1309  Â·  4Comments

bruno-garcia picture bruno-garcia  Â·  5Comments

marandaneto picture marandaneto  Â·  6Comments