Repository navigation
Android. NoSuchMethodError (NoSuchMethodError: No top-level getter '_registerPlugins' declared. #77680
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
I am developing a plugin that execute dartCallback in background service.
But I got this exception when I run the example app.
NoSuchMethodError (NoSuchMethodError: No top-level getter '_registerPlugins' declared.
Steps to Reproduce
- Clone https://github.com/ekasetiawans/flutter_background_service
- Run example project on Android
- Exception thrown
Expected results:
Exception not thrown.
Actual results:
Exception thrown.
Logs
ekasetiawans@MacBookPro ~ % flutter doctor -v
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.3 20D91 darwin-x64, locale
en-ID)
• Flutter version 2.0.1 at /Users/ekasetiawans/Development/flutter-stable
• Framework revision c5a4b4029c (5 days ago), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/ekasetiawans/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• 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
1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.54.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.20.0
[✓] Connected device (3 available)
• sdk gphone x86 64 arm64 (mobile) • emulator-5554 • android-x64 •
Android 11 (API 30) (emulator)
• macOS (desktop) • macos • darwin-x64 • macOS
11.2.3 20D91 darwin-x64
• Chrome (web) • chrome • web-javascript • Google
Chrome 87.0.4280.88
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
ekasetiawans commentedon Mar 9, 2021
TahaTesser commentedon Mar 9, 2021
Hi @ekasetiawans
It seems you are asking for assistance on personal code. Please see https://flutter.dev/community for resources and asking questions like this,
you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
Thank you
ekasetiawans commentedon Mar 9, 2021
@TahaTesser no, i just report, I got that exception. the code just works before flutter 2.
ekasetiawans commentedon Mar 9, 2021
@TahaTesser maybe the exception came from this #74469 but I'm not sure.
ekasetiawans commentedon Mar 9, 2021

There isn't any _registerPlugins text in my source code, so I'm pretty sure that this exception is in flutter sdk.TahaTesser commentedon Mar 9, 2021
@ekasetiawans
Based on my search, similar errors are reported by the code issues but here it might be different, I will reproduce it
TahaTesser commentedon Mar 9, 2021
Hi @ekasetiawans
Running your the example app on the latest
stable, no such error I can reproducelogs
flutter doctor -v
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale en-GB) • Flutter version 2.0.1 at /Users/tahatesser/Code/flutter_stable • Framework revision c5a4b4029c (5 days ago), 2021-03-04 09:47:48 -0800 • Engine revision 40441def69 • Dart version 2.12.0 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Volumes/Extreme/SDK • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /Volumes/Extreme/SDK • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer • Xcode 12.4, Build version 12D4e • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • 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 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.54.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.20.0 [✓] Connected device (4 available) • SM M025F (mobile) • R9ZR205XX0A • android-arm • Android 10 (API 29) • Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios • iOS 14.4 • macOS (desktop) • macos • darwin-x64 • macOS 11.2.2 20D80 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.82 • No issues found!Please steps to reproduce the issue and also provide a flutter version which this wasn't an issue to confirm regression
Thank you
32 remaining items
johnpryan commentedon Apr 5, 2021
@orestesgaolin found some steps to reproduce this exception - launch the app using a deep link on an Android emulator after it has been closed with the back button twice. I added them to this issue. This happens on the master and stable channel.
The
flutter run -voutput doesn't show the exception AFAICT, so I left it out. Here's the output I see:Logs
zanderso commentedon Apr 5, 2021
@blasten with the change re-landed in the engine, can you try to repro using these instructions?
ekasetiawans commentedon Apr 5, 2021
@zanderso I made screenrecord
here https://drive.google.com/file/d/1mL2CsKc61mvqD05rvVyNZYSD1mxjiRec/view?usp=sharing
blasten commentedon Apr 5, 2021
I was able to reproduce #79810, and I'm investigating.
blasten commentedon Apr 5, 2021
This appears to only occur when the app is launched from VSCode with an attached debugger. I'm unable to reproduce it with just
flutter run. The VSCode extension runs the VM with different flags. https://github.com/Dart-Code/Dart-Code/blob/57ead070d6a96d42839b6c6fe148716d9f8b97f1/src/debug/flutter_debug_impl.ts#L228zanderso commentedon Apr 6, 2021
@blasten What are the differences? Just
--start-pausedor were there also others?--start-pausedis pretty common, and we'll have to continue supporting that.blasten commentedon Apr 6, 2021
I've been using
flutter run --start-pausedand the debugger, but I'm still unable to reproduce the same behavior observed from the VSCode extension. I will try to build the extension.@ekasetiawans can you also confirm that if you type in the command line
flutter run, you don't get the exception?ekasetiawans commentedon Apr 6, 2021
@blasten yes, I don't get the exception when using
flutter runcommandblasten commentedon Apr 12, 2021
Fixed by flutter-team-archive/engine#25496
cuongvue commentedon May 7, 2021
which flutter version can I use to fix this bug please? I'm using
Channel stable, 2.0.6but get the same errorzanderso commentedon May 7, 2021
It looks like the revert above should have made it into the
2.2beta.github-actions commentedon Aug 2, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.