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

MissingPluginException #599

Closed
3 of 11 tasks
lauroboeni opened this issue Sep 23, 2021 · 7 comments
Closed
3 of 11 tasks

MissingPluginException #599

lauroboeni opened this issue Sep 23, 2021 · 7 comments

Comments

@lauroboeni
Copy link

lauroboeni commented Sep 23, 2021

Platform:

  • Dart
  • Flutter Android or iOS
  • Flutter Web

IDE:

  • VSCode
  • IntelliJ/AS
  • XCode
  • Other, which one?

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

  • Enabled
  • Disabled

Platform installed with:

  • pub.dev
  • GitHub

Output of the command flutter doctor -v below:
`[√] Flutter (Channel stable, 2.5.0, on Microsoft Windows [Version 10.0.19043.1237], locale de-CH)
• Flutter version 2.5.0 at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b4b8 (2 weeks ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at C:\Users\LauroBoeni\AppData\Local\Android\Sdk
• Platform android-30, build-tools 30.0.1
• ANDROID_SDK_ROOT = C:\Users\LauroBoeni\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• 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 1.8.0_242-release-1644-b01)

[√] VS Code, 64-bit edition (version 1.60.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.26.0

[√] Connected device (3 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82
• Edge (web) • edge • web-javascript • Microsoft Edge 93.0.961.47

• No issues found!`

The version of the SDK (See pubspec.lock):
sentry: dependency: transitive description: name: sentry url: "https://pub.dartlang.org" source: hosted version: "6.0.1" sentry_flutter: dependency: "direct main" description: name: sentry_flutter url: "https://pub.dartlang.org" source: hosted version: "6.0.1"


I have the following issue:

When launching the app on an android Emulator in debug mode, I'm getting the following errors:

`[sentry] [fatal] nativeSdkIntegration failed to be installed
[sentry] MissingPluginException (MissingPluginException(No implementation found for method initNativeSdk on channel sentry_flutter))
[sentry] #0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:154

#1 NativeSdkIntegration.call (package:sentry_flutter/src/default_integrations.dart:234:7)

#2 Sentry._callIntegrations (package:sentry/src/sentry.dart:134:7)

#3 Sentry._init. (package:sentry/src/sentry.dart:114:9)

#4 RunZonedGuardedIntegration.call. (package:sentry/src/default_integrations.dart:27:9)

[sentry] [error] Failed to load release and dist
[sentry] MissingPluginException (MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info))
[sentry] #0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:154
`

I just tried to integrate sentry_flutter package into our flutter project and faced above described error - any ideas for the reason?

@marandaneto
Copy link
Contributor

@lauroboeni can you share the SDK init code snippet?

@lauroboeni
Copy link
Author

lauroboeni commented Sep 23, 2021

sure - thanks for the fast response. Here is the SDK init code:

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  FlareCache.doesPrune = false;

  // setupLogger();
  await GetStorage.init();
  await setupLocator();
  setupDialogServices();
  setupBottomSheetUi();
  setupSnackbarServices();
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
    DeviceOrientation.portraitDown,
  ]);

  await SentryFlutter.init(
    (options) {
      // options.tracesSampleRate = 1.0;
      options.reportPackages = false;
      options.dsn = '******';
    },
    appRunner: initApp,
  );
}

void initApp() {
  runApp(
        ChangeNotifierProvider<AppStateNotifier>(
          create: (context) => AppStateNotifier(),
          child: MainApp(),
        ),
      );
}

@marandaneto
Copy link
Contributor

the problem is that you call WidgetsFlutterBinding.ensureInitialized();, Sentry already does it automatically, if you have to call it before initing Sentry, you have to go with a custom runZonedGuarded and call WidgetsFlutterBinding.ensureInitialized(); inside of it.

there's an example in the readme -> https://github.com/getsentry/sentry-dart/blob/main/dart/README.md

would you mind trying that out?

@lauroboeni
Copy link
Author

Unfortunately that error still occur when I wrap WidgetsFlutterBinding.ensureInitilaized();, into a custom ronZoneGuarded. Even if I comment out the WidgetsFlutterBinding.ensureInitilaized(); the error occurs

@lauroboeni
Copy link
Author

what I found out is that if I initialize sentry using Sentry.init(), this error does not occur. However if I initialize if with SentryFlutter.init() the error occurs as described above. In both cases I have WidgetsFlutterBinding.ensureInitialized(); at the very beginning.

@marandaneto
Copy link
Contributor

can you share your sdk init code snippet with the usage of the custom ronZoneGuarded? or please upload a sample repro to Github, I can't reproduce it when using the custom ronZoneGuarded correctly

@lauroboeni
Copy link
Author

@marandaneto I could fix it. I cleaned the cache and then it worked properly :) Thanks anyways!

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

No branches or pull requests

2 participants