Repository navigation
Description
Steps to reproduce
Version: Flutter (Channel stable, 3.32.1)
When I use the release package, MissingPluginException error occurs, but when I run the debug package, such a problem does not occur.
Then I found that in the debug version, the automatically generated GeneratedPluginRegistrant file includes these two plugins, but the GeneratedPluginRegistrant file after executing the packaging command does not.
How to solve this problem in this case?
Expected results
The debug version is consistent with the release version.
Actual results
MissingPluginException(No implementation found for method getDeviceInfo on channel dev.fluttercommunity.plus/device_info) stack=#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368)
or
MissingPluginException(No implementation found for method openDatabase on channel com.davidmartos96.sqflite_sqlcipher) stack=#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368)
Code sample
no code...
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.32.1, on Microsoft Windows [版本 10.0.19045.2728], locale zh-CN)
! Upstream repository https://github.com/flutter/flutter.git is not the same as FLUTTER_GIT_URL
[√] Windows Version (10 专业版 64 位, 22H2, 2009)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2022.3)
[√] Connected device (3 available)
[!] Network resources
X A cryptographic error occurred while checking "https://storage.flutter-io.cn": Handshake error in client
You may be experiencing a man-in-the-middle attack, your network may be compromised, or you may have malware installed on your computer.
X A network error occurred while checking "https://github.com/": Failed host lookup: 'github.com'
Activity
tirth-patel-nc commentedon Jun 4, 2025
thanks for reporting. based on the error logs, this seems related to the device_info_plus and sqflite_sqlcipher packages rather than flutter itself. it's hard to investigate further without more context.
for us to further investigate this issue, please provide a completed and minimal reproducible code sample that doesn’t include 3rd party plugins or complex production code. Thank you!
stuartmorgan-g commentedon Jun 4, 2025
GeneratedPluginRegistrant is created by the
fluttertool, and should include all plugins used by the application, regardless of whether they are first-party or third-party.Please provide the exact commands you are running, and either a project that reproduces it, or the exact steps to create such a project. We need to be able to reproduce the issue in order to investigate further.
gghh0408 commentedon Jun 5, 2025
The command to compile a release version is flutter build apk. However, I believe I've identified a different issue: I noticed several missing plugins were listed under dev_dependencies instead of dependencies in my pubspec.yaml. After moving these third-party libraries to dependencies, the GeneratedPluginRegistrant could properly locate them during compilation. This behavior was consistent in both Flutter 3.22.2 (my stable version) and 3.29.2.
gghh0408 commentedon Jun 5, 2025
I probably understand the difference between the two, but I'm just curious why it worked in previous versions but not in the latest one.
tirth-patel-nc commentedon Jun 5, 2025
Added those 2 plugins under dev_dependencies and APK built fine for me.
gghh0408 commentedon Jun 5, 2025
I have obtained a streamlined version of the code and hope it will be helpful to you. In fact, as I mentioned above, after modifying the location, it worked properly, but this seems a bit strange. Below is a screenshot of my Android Studio version. Could the reason for the anomaly be that this version is too old and incompatible with Gradle? I am confused and hope to get an answer.
I can't upload the compressed package of my temporary test project here, so please visit this link.
https://github.com/gghh0408/TestProject
I hope it will be helpful to you.
gghh0408 commentedon Jun 5, 2025
The situation on my side is that the APK can also be successfully compiled. However, the automatically generated GeneratedPluginRegistrant file contains fewer entries than those when running in debug mode. Interestingly, the missing plugins are exactly those configured in dev_dependencies.
I'm not sure if this is caused by incompatible environment variables. If possible, please try compiling the simple project I provided above to see.
stuartmorgan-g commentedon Jun 5, 2025
In that case, the observed behavior is correct, so closing.
Including native code from dev dependencies in release builds was a long-standing bug which was recently fixed.
github-actions commentedon Jun 19, 2025
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.