简体   繁体   English

在模拟器中使用图像选择器上传图像时出错 - Flutter 应用程序

[英]Error while uploading image using image picker in emulator - Flutter app

Please how can I fix this error?请问我该如何解决这个错误? I use the image picker but when I select the image in the gallery from the emulator it doesn't appear.我使用图像选择器,但是当我 select 来自模拟器的画廊中的图像时,它没有出现。

Here is the complete error text:这是完整的错误文本:

D/EGL_emulation(19810): eglMakeCurrent: 0xa70bcb40: ver 2 0 (tinfo 0x9395e330) D/EGL_emulation(19810):eglMakeCurrent:0xa70bcb40:ver 2 0(tinfo 0x9395e330)

W/GooglePlayServicesUtil(19810): Google Play services out of date for com.example.chat_app. W/GooglePlayServicesUtil(19810):com.example.chat_app 的 Google Play 服务已过期。 Requires 12451000 but found 11743470需要 12451000 但找到 11743470

I/art (19810): Do partial code cache collection, code=22KB, data=30KB I/art (19810): After code cache collection, code=20KB, data=30KB I/art (19810): Increasing code cache capacity to 128KB I/art (19810): 做部分代码缓存收集,code=22KB, data=30KB I/art (19810): 代码缓存收集后,code=20KB, data=30KB I/art (19810): 增加代码缓存容量到 128KB

D/EGL_emulation(19810): eglMakeCurrent: 0xa70bc3c0: ver 2 0 (tinfo 0xa70c0bd0) D/EGL_emulation(19810): eglMakeCurrent: 0xa70bc3c0: ver 2 0 (tinfo 0xa70c0bd0) D/EGL_emulation(19810): eglMakeCurrent: 0xa70bcb40: ver 2 0 (tinfo 0x9395e330) D/EGL_emulation(19810):eglMakeCurrent:0xa70bc3c0:ver 2 0 (tinfo 0xa70c0bd0) D/EGL_emulation(19810):eglMakeCurrent:0xa70bc3c0:ver 2 0 (tinfo 0xa70c0bd0) D/EGL_emulation(19810):b0bc470:eglMakeCurrent (信息 0x9395e330)

E/flutter (19810): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'XFile' is not a subtype of type 'File?' E/flutter (19810): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] 未处理的异常:“XFile”类型不是“File”类型的子类型? in type cast E/flutter (19810): #0在 type cast E/flutter (19810) 中:#0
_UserImagePickerState._pickedImage. _UserImagePickerState._pickedImage。 (package:chat_app/widgets/pickers/user_image_picker.dart:19:37) E/flutter (19810): #1 State.setState (package:flutter/src/widgets/framework.dart:1121:30) E/flutter (19810): #2 _UserImagePickerState._pickedImage (package:chat_app/widgets/pickers/user_image_picker.dart:18:5) E/flutter (19810): E/flutter (19810): (包:chat_app/widgets/pickers/user_image_picker.dart:19:37)E/flutter(19810):#1 State.setState(包:flutter/src/widgets/framework.dart:1121:30)E/flutter( 19810): #2 _UserImagePickerState._pickedImage (package:chat_app/widgets/pickers/user_image_picker.dart:18:5) E/flutter (19810): E/flutter (19810):

I think, that this string: "Google Play services out of date for com.example.chat_app. Requires 12451000 but found 11743470" says about use out of dated version of Android needed to using widget.我认为,这个字符串:“com.example.chat_app 的 Google Play 服务已过时。需要 12451000 但发现 11743470”表示使用小部件所需的 Android 的过时版本。

try to use newer version of Android in your emulator.尝试在您的模拟器中使用更新版本的 Android。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM