当我打开相机以使用图像选择器设置个人资料图像时,应用程序崩溃并且我失去了与设备的连接
:
从图库中提取图像时,它工作正常,
my pubspec.yaml
name: flutterapp
description: A new Flutter project.
# Prevent accidental publishing to pub.dev.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
connectivity: ^3.0.6
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
font_awesome_flutter:
geolocator: ^7.7.0
http: ^0.13.4
image_picker: ^0.8.4+3
local_auth: ^1.1.8
path_provider: ^2.0.5
pdf: ^3.6.0
permission_handler: ^8.2.5
shared_preferences: ^2.0.8
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter:
uses-material-design: true
# Enable generation of localized Strings from arb files.
generate: true
assets:
# Add assets from the images directory to the application.
- assets/
最佳答案
我遇到了同样的问题,我检查了内存状态,是的,这种情况发生是因为设备的内存 RAM 已满并自动关闭任务,所以。
Image.file( File(path), filterQuality: FilterQuality.none, cacheHeight: 66, cacheWidth: 50, )
对不起我的英语。
关于android - 当从图像选择器打开相机时,应用程序 "Lost connection to device.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69806383/