gpt4 book ai didi

android - 当从图像选择器打开相机时,应用程序 "Lost connection to device."

转载 作者:行者123 更新时间:2023-12-05 00:18:04 25 4
gpt4 key购买 nike

当我打开相机以使用图像选择器设置个人资料图像时,应用程序崩溃并且我失去了与设备的连接
: enter image description here
从图库中提取图像时,它工作正常,

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 已满并自动关闭任务,所以。

  • 我在flutter的observatory中查看状态内存,在应用程序运行时按“Ctrl + Shift + P”并写入observatory查看设备的内存状态enter image description here enter image description here
  • 我用 Image.file 小部件的属性定义了 cacheHeight 和 cacheWidth ,并且我修改了 filterQuality 属性:

  • Image.file(File(path),filterQuality: FilterQuality.none,cacheHeight: 66,cacheWidth: 50,)


    对不起我的英语。

    关于android - 当从图像选择器打开相机时,应用程序 "Lost connection to device.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69806383/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com