我的 flutter 应用程序遇到了问题,应用程序在一段时间后被杀死

i am having an issue with my flutter app where app is being killed after sometime

提问人:Jaydeep savaliya 提问时间:11/16/2023 更新时间:11/16/2023 访问量:32

问:

下面是我在控制台中收到的一个警告,没有其他错误日志,应用程序只是被自动杀死,系统启动器被挂起,有时手机也会重新启动,我检查了我使用的所有软件包,没有发现问题,有人可以建议我如何调试这个问题。

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Stream has been disposed.
An ImageStream is considered disposed once at least one listener has been added and subsequently all listeners have been removed and no handles are outstanding from the keepAlive method.
To resolve this error, maintain at least one listener on the stream, or create an ImageStreamCompleterHandle from the keepAlive method, or create a new stream for the image.
#0      ImageStreamCompleter._checkDisposed (package:flutter/src/painting/image_stream.dart:607:7)
#1      ImageStreamCompleter.reportImageChunkEvent (package:flutter/src/painting/image_stream.dart:747:5)
#2      _RootZone.runUnaryGuarded (dart:async/zone.dart:1593:10)
#3      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#4      _DelayedData.perform (dart:async/stream_impl.dart:515:14)
#5      _PendingEvents.handleNext (dart:async/stream_impl.dart:620:11)
#6      _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:591:7)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)

我尝试删除额外的软件包,现在仍然没有问题,我仍然给出了它的列表。

cupertino_icons: ^1.0.2
  firebase_core:
  firebase_dynamic_links:
  otp_text_field: ^1.1.1
  flutter_svg: ^1.1.1+1
  lottie: ^1.2.1
  country_picker: ^2.0.8
  carousel_slider: ^4.0.0
  cloud_firestore: ^4.7.0
  fluttertoast: ^8.2.2
  modal_bottom_sheet: ^3.0.0-pre
  flutter_rating_bar: ^4.0.0
  google_fonts: ^4.0.0
  flutter_colorpicker: ^1.0.3
  shared_preferences: ^2.0.7
  flutter_font_picker: ^1.2.0
  image_picker: ^0.8.5
  image_cropper: ^3.0.0
  getwidget: ^3.0.1
  cached_network_image: ^3.2.0
  flutter_image_slideshow: ^0.1.2
  dropdown_button2: ^1.4.0
  flutter_swiper_null_safety: ^1.0.2
  visibility_detector: ^0.3.3
  badges: ^2.0.3
  equatable: ^2.0.3
  intl: ^0.17.0
  share_plus: ^4.0.10
  path_provider: ^2.0.11
  syncfusion_flutter_datepicker: ^20.1.61
  syncfusion_flutter_datagrid: ^20.1.61
  share: ^2.0.4
  decimal: ^2.2.0
  pdf: ^3.8.1
  photo_view: ^0.14.0
  geolocator: ^9.0.1
  geocoding: ^2.0.4
  permission_handler: ^10.0.0
  country_currency_pickers: ^2.0.0
  currency_picker: ^2.0.11
  razorpay_flutter: ^1.3.2
  assets_audio_player: ^3.0.5
  url_launcher: ^6.1.5
  csc_picker: ^0.2.6
  intl_phone_field: ^3.1.0
  flutter_paypal: ^0.0.8
  audioplayers: ^1.0.1
  flutter_beep: ^1.0.0
  google_geocoding: ^0.2.0
  share_extend: ^2.0.0
  upgrader: ^4.6.1
  dotted_border: ^2.0.0+1
  pinch_zoom: ^1.0.0
  shimmer: ^2.0.0
  social_share: ^2.2.1
  csv: ^5.0.1
  firebase_messaging:
  flutter_local_notifications: ^11.0.1
  in_app_review: ^2.0.4
  flutter_html:
  flutter_widget_from_html: ^0.9.0
  flutter_barcode_scanner: ^2.0.0
  linked_scroll_controller: ^0.2.0
  flutter_ringtone_player: ^3.2.0
  location: ^4.4.0
  youtube_player_flutter: ^8.1.1
  flutter_linkify: ^5.0.2
  provider: ^6.0.0
  avatar_glow:
  animator: ^3.0.0
  animated_text_kit: ^4.2.2
  lazy_load_scrollview: 1.3.0
  data_table_2: ^2.1.0
  http: ^0.13.4
  flutter_otp_text_field: ^1.1.1
  firebase_analytics:
  get: ^4.6.5
  firebase_auth:
  flutter_toggle_tab: ^1.2.0
  translator: ^0.1.7
  open_street_map_search_and_pick: ^0.1.0
  flutter_calendar_carousel: ^2.0.0
颤振 崩溃

评论

0赞 Randal Schwartz 11/16/2023
操作系统可以根据供应商选择的算法随时终止移动应用程序。
1赞 Jaydeep savaliya 11/16/2023
我想我遇到了我的问题,实际上我的应用程序在主页上有很多(100+)来自API的高质量网络图像,并且我使用了缓存的网络图像,所以发生的事情是这些图像占据了大部分RAM(4 GB),所以它被100%使用并崩溃了我的系统。具有 8 GB RAM 的设备没有问题
0赞 il_boga 11/16/2023
如果您自己发现了问题,您应该回答自己的问题并将该答案标记为正确答案,因此该问题将被视为已解决

答: 暂无答案