[英]MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
Flutter application is stuck on splash page on release mode(only) Sharing the error stack trace Flutter 应用程序在发布模式下卡在启动页面上(仅)共享错误堆栈跟踪
E/flutter (24026): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
E/flutter (24026): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156)
E/flutter (24026): #1 getApplicationDocumentsDirectory (package:path_provider/path_provider.dart:138)
E/flutter (24026): #2 HiveX.initFlutter (package:hive_flutter/src/hive_extensions.dart:12)
E/flutter (24026): #3 Future.wait.<anonymous closure> (dart:async/future.dart)
E/flutter (24026): #4 initializePlugins (package:application/main.dart:93)
E/flutter (24026): #5 main (package:application/main.dart:116)
I am able to resolve the issue by disabling minify in android build gradle我可以通过在 android build gradle 中禁用 minify 来解决这个问题
Thanks for sharing the answer感谢分享答案
android {
...
buildTypes {
release {
...
shrinkResources false
minifyEnabled false
}
}
}
Is there a way to solve this issue without disabling minifyEnabled ?有没有办法在不禁用 minifyEnabled 的情况下解决这个问题?
Ok this is a little bug.好的,这是一个小错误。 If you add new library or plugin and run hot restart this will occur.如果您添加新库或插件并运行热重启,则会发生这种情况。 Try to clean the project using flutter clean command then kill the running application from our device then run it again.尝试使用 flutter clean 命令清理项目,然后从我们的设备中终止正在运行的应用程序,然后再次运行它。 Hope this will solved.希望这会解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.