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

Logging not working in flutter sentry's ios version on a self hosted sentry server version Sentry 20.11.1 4468076 #748

Closed
vamsi575kg opened this issue Feb 10, 2022 · 1 comment

Comments

@vamsi575kg
Copy link

vamsi575kg commented Feb 10, 2022

Platform:
Flutter Android or iOS

IDE:
Android Studio

split-debug-info and obfuscate (Flutter Android or iOS) or CanvasKit (Flutter Web):
Disabled

Platform installed with:
pub.dev

Output of the command flutter doctor -v below:

[✓] Flutter (Channel stable, 2.8.1, on macOS 11.6 20G165 darwin-arm, locale en-IN)
• Flutter version 2.8.1 at ~/Documents/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (8 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at ~/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.64.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 31) (emulator)
• iPod touch (7th generation) (mobile) • 5CB565C1-FE20-4C41-BEC0-A043AF6606D0 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 11.6 20G165 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80

• No issues found!

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


I have the following issue:

I am using the sample example project (https://github.com/getsentry/sentry-dart/tree/main/flutter/example)

The exception logs are not showing up for ios version. But works fine for android.

Here is my initialization

Main.dart
await SentryFlutter.init(
(options) {
options.dsn = _exampleDsn;
options.debug = true;
options.tracesSampleRate = 1.0;
},
// Init your App.
appRunner: () => runApp(MyApp()),
);

Console logs

Launching lib/main.dart on iPod touch (7th generation) in debug mode...
Running Xcode build...
Xcode build done. 22.4s
Debug service listening on ws://127.0.0.1:49565/7DAQ-sELPXo=/ws
Syncing files to device iPod touch (7th generation)...
[sentry] [debug] release: **bundle-id@6.3.0+6.3.0
[sentry] [debug] Capture from onError Scaffold.of() called with a context that does not contain a Scaffold.
No Scaffold ancestor could be found starting from the context that was passed to Scaffold.of(). This usually happens when the context provided is from the same StatefulWidget as that whose build function actually creates the Scaffold widget being sought.
There are several ways to avoid this problem. The simplest is to use a Builder to get a context that is "under" the Scaffold. For an example of this, please see the documentation for Scaffold.of():
https://api.flutter.dev/flutter/material/Scaffold/of.html
A more efficient solution is to split your build function into several widgets. This introduces a new context from which you can obtain the Scaffold. In this solution, you would have an outer widget that creates the Scaffold populated by instances of your new inner widgets, and then in these inner widgets you would use Scaffold.of().
A less elegant but more expedient solution is assign a GlobalKey to the Scaffold, then use the key.currentState property to obtain the ScaffoldState rather than using the Scaffold.of() function.
The context used was:
MainScaffold
[sentry.flutterError] [error] Exception caught by gesture
Scaffold.of() called with a context that does not contain a Scaffold.
No Scaffold ancestor could be found starting from the cont...
#0 Scaffold.of (package:flutter/src/material/scaffold.dart:1785:5)
#1 MainScaffold.build. (package:sentry_flutter_example/main.dart:142:41)
#2 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:989:21)
#3 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:198:24)
#4 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:608:11)
#5 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:296:5)
#6 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:267:7)

Steps to reproduce:

@vamsi575kg vamsi575kg changed the title Logging not working in flutter sentry's ios version of example project Logging not working in flutter sentry's ios version on a self hosted sentry server version Sentry 20.11.1 4468076 Feb 10, 2022
@vamsi575kg vamsi575kg changed the title Logging not working in flutter sentry's ios version on a self hosted sentry server version Sentry 20.11.1 4468076 Logging not working in flutter sentry's ios version on a self hosted sentry server version Sentry 20.11.1 4468076 Feb 10, 2022
@marandaneto
Copy link
Contributor

Screenshot 2022-02-10 at 12 28 29

I've just tested it and it works out, using the same simulator or iPhone 13.
Watch the logs of your Sentry server, maybe there's something in there, or upgrade to the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants