flutter - Flutter - MissingPluginException(在通道 plugins.flutter.io/image_picker 上找不到方法 pickImage 的实现)
问题描述
我正在尝试使用 image_picker 包从图库中选择图像,无论如何这个错误都会持续存在。我已经尝试过的解决方案:
- 终止、清理、重新运行、重新启动 IDE 和重新启动 PC
- 更改 compileSdkVersion 和 targetSdkVersion
- 降级软件包版本
Unhandled Exception: MissingPluginException(No implementation found for method pickImage on channel plugins.flutter.io/image_picker)
E/flutter ( 2928): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7)
E/flutter ( 2928): <asynchronous suspension>
E/flutter ( 2928): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
我用来获取图像的功能:
void getPicture() async{
final picker = ImagePicker();
final pickedFile = await picker.getImage(source: ImageSource.gallery);
_image = File(pickedFile.path);
_picLink = await dbOnlineInstance.uploadProfilePic(_image, authInstance.firebaseAuthInstance.currentUser.email);
notifyListeners();
}
例如,某些软件包是否会因冲突而禁用其他软件包?我安装的软件包:
cupertino_icons: ^0.1.3
splashscreen:
provider:
route_transitions:
flutter_vector_icons:
simple_animations:
supercharged:
animated_background:
sqflite:
path:
toggle_switch:
firebase_auth:
firebase_core:
cloud_firestore:
image_picker:
shared_preferences:
cached_network_image:
firebase_storage:
google_sign_in:
flutter_facebook_auth:
draggable_widget:
enum_to_string:
stacked:
auto_route:
stacked_services:
get_it:
injectable:
还是权限问题?虽然这个包不需要权限并且错误本身与权限无关。
解决方案
我遇到了与您类似的问题,但我的问题介于flutter_facebook_auth和sqflite之间。
我收到(在执行“flutter run”之后):未处理的异常:MissingPluginException(在通道 com.tekartik.sqflite.SqflitePlugin 上找不到方法 getDatabasesPath 的实现)
解决方案是在阅读@Ismaeil Ghouneim回复后,谢谢!
我在这里按照本教程进行了所有配置:https ://facebook.meedu.app/#/一切都恢复正常了!
推荐阅读
- swift - 为什么我在 swift 中的自定义 @objc 函数在自动填充中有删除线?
- generics - Kotlin:我的通用函数中未经检查的强制转换
- amazon-web-services - AWS Step Functions 任务超时
- ssl - /etc/ssl/cert.pem 中的证书今天过期(MacOS Mojave)
- .net - Azure Servicebus 循环竞争消费者
- github - 如何使用 github API 获取 Github 拉取请求评论线程
- javascript - 邮递员预先请求获取令牌不起作用
- node.js - youtube 搜索没有获取 URLS
- android - 我从哪里开始制作安卓应用程序?
- python - 如何在python中添加if else语句以及函数定义