781flyingdutchman / background_downloader

Flutter plugin for file downloads and uploads
Other
136 stars 63 forks source link

The plugin makes run release project crash on startup #116

Closed asfarul closed 10 months ago

asfarul commented 11 months ago

Hello, i have a problem after i installed background_downloader package on my running project. i haven't setup anything in my code yet, i just install the plugin then the error appears on startup and affects all of my plugins

i'm using background_downloader:^7.8.1 for information, previously I used flutter_downloader but now I have removed it then running the project on release mode, it worked without background_downloader plugin

this is the error from log after i put background_downloader on dependencies and run release mode :


E/flutter (24794): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method getDeviceInfo on channel dev.fluttercommunity.plus/device_info)
E/flutter (24794): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #1      MethodChannelDeviceInfo.deviceInfo (package:device_info_plus_platform_interface/method_channel/method_channel_device_info.dart:19)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #2      DeviceInfoPlugin.androidInfo (package:device_info_plus/device_info_plus.dart:53)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #3      ErrorLogServices.send (package:wemeetmid_mobile/services/error_log_services.dart:16)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794):
E/flutter (24794): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method getDeviceInfo on channel dev.fluttercommunity.plus/device_info)
E/flutter (24794): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #1      MethodChannelDeviceInfo.deviceInfo (package:device_info_plus_platform_interface/method_channel/method_channel_device_info.dart:19)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #2      DeviceInfoPlugin.androidInfo (package:device_info_plus/device_info_plus.dart:53)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #3      ErrorLogServices.send (package:wemeetmid_mobile/services/error_log_services.dart:16)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794):
E/flutter (24794): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method getDeviceInfo on channel dev.fluttercommunity.plus/device_info)
E/flutter (24794): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #1      MethodChannelDeviceInfo.deviceInfo (package:device_info_plus_platform_interface/method_channel/method_channel_device_info.dart:19)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #2      DeviceInfoPlugin.androidInfo (package:device_info_plus/device_info_plus.dart:53)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #3      ErrorLogServices.send (package:wemeetmid_mobile/services/error_log_services.dart:16)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794):
E/flutter (24794): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method getDeviceInfo on channel dev.fluttercommunity.plus/device_info)
E/flutter (24794): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #1      MethodChannelDeviceInfo.deviceInfo (package:device_info_plus_platform_interface/method_channel/method_channel_device_info.dart:19)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #2      DeviceInfoPlugin.androidInfo (package:device_info_plus/device_info_plus.dart:53)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #3      ErrorLogServices.send (package:wemeetmid_mobile/services/error_log_services.dart:16)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794):
E/flutter (24794): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
E/flutter (24794): #0      MethodChannelFirebase.app (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:193)
E/flutter (24794): #1      Firebase.app (package:firebase_core/src/firebase.dart:56)
E/flutter (24794): #2      FirebaseCrashlytics.instance (package:firebase_crashlytics/src/firebase_crashlytics.dart:33)
E/flutter (24794): #3      main.<anonymous closure> (package:wemeetmid_mobile/main.dart:314)
E/flutter (24794): #4      FlutterError.reportError (package:flutter/src/foundation/assertions.dart:1185)
E/flutter (24794): #5      RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1248)
E/flutter (24794): #6      RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1209)
E/flutter (24794): #7      RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:1156)
E/flutter (24794): #8      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2720)
E/flutter (24794): #9      RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1155)
E/flutter (24794): #10     WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:988)
E/flutter (24794): #11     WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:968)
E/flutter (24794): #12     TickerFuture.whenCompleteOrCancel.thunk (package:flutter/src/scheduler/ticker.dart:420)
E/flutter (24794): #13     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398)
E/flutter (24794): #14     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429)
E/flutter (24794): #15     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189)
E/flutter (24794):
E/flutter (24794): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
E/flutter (24794): #0      PathProviderApi.getApplicationSupportPath (package:path_provider_android/messages.g.dart:65)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #1      getApplicationSupportDirectory (package:path_provider/path_provider.dart:78)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #2      _localPath (package:google_fonts/src/file_io_desktop_and_mobile.dart:39)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #3      _localFile (package:google_fonts/src/file_io_desktop_and_mobile.dart:44)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794): #4      saveFontToDeviceFileSystem (package:google_fonts/src/file_io_desktop_and_mobile.dart:15)
E/flutter (24794): <asynchronous suspension>
E/flutter (24794):```

thanks before 
781flyingdutchman commented 11 months ago

Hi, sorry you're running into this. None of the error messages you list here relate to the background_downloader though, so I am not sure I can help. Have you tried flutter clean and building again?

asfarul commented 11 months ago

yeah, but still not working... i dont know why, when i put background_downloader in my dependecy... it looks like the others plugin don't work, then if i remove, i can run the release mode

781flyingdutchman commented 11 months ago

Weird. Can you try pinning the background_downloader version to 7.8.0 (dropping the ^) and see if it works then? I wonder if something snuck into the latest version that causes this issue. The other thing to look at is your FlutterActivity on Android, or AppDelegate on iOS to see if something there is off. I haven't come across this issue before, so hoping someone else can perhaps add a perspective.

asfarul commented 11 months ago

Still not working

here is my env sdk sdk: ">=2.17.0 <4.0.0"

here's my dependencies

dependencies:
  alt_sms_autofill: ^1.0.0
  android_id: ^0.3.3
  animated_bottom_navigation_bar: ^1.2.0
  animated_list_plus: ^0.4.5
  animations: ^2.0.7
  app_settings: ^4.1.1
  audio_waveforms: ^1.0.2
  avatar_stack: ^1.2.0
  background_downloader: 7.8.0
  blurhash_dart: ^1.1.0
  bubble: ^1.2.1
  cached_network_image: ^3.1.0+1
  camera: ^0.10.0+4
  carousel_slider: ^4.1.1
  characters: ^1.2.1
  chewie: ^1.3.5
  collection: ^1.16.0
  concentric_transition: ^1.0.3
  confetti: ^0.7.0
  contacts_service: ^0.6.3
  country_calling_code_picker: ^2.0.1
  cupertino_icons: ^1.0.5
  day_night_time_picker: ^1.2.0+2
  device_calendar: ^4.3.1
  device_info_plus: ^9.0.2
  dio: ^5.0.3
  dotted_border: ^2.0.0+2
  easy_refresh: ^3.3.1
  emoji_picker_flutter: ^1.5.4
  encrypt: ^5.0.1
  expandable: ^5.0.1
  extended_nested_scroll_view: ^6.1.2
  extended_sliver: ^2.1.3
  fast_rsa: ^3.4.6
  ffmpeg_kit_flutter_full_gpl: ^5.1.0
  file_picker: ^5.2.2
  firebase_auth: ^4.7.1
  firebase_core: ^2.15.0
  firebase_crashlytics: ^3.3.4
  firebase_messaging: ^14.6.5
  flutter:
    sdk: flutter
  flutter_animarker: ^3.2.0
  flutter_animation_progress_bar: ^2.3.1
  flutter_blurhash: ^0.7.0
  flutter_bounceable: ^1.1.0
  flutter_cache_manager: ^3.3.0
  flutter_chat_ui: 1.6.9
  flutter_colorpicker: ^1.0.3
  flutter_datetime_picker_plus: ^2.0.1
  flutter_image_compress: ^2.0.0
  flutter_isolate: ^2.0.3
  flutter_linkify: ^6.0.0
  flutter_lints: ^2.0.1
  flutter_local_notifications: ^15.1.0+1
  flutter_native_image: ^0.0.6+1
  flutter_native_splash: 2.2.18
  flutter_secure_storage: ^8.0.0
  flutter_sim_country_code: ^0.1.2
  flutter_sms: ^2.3.3
  flutter_sound: ^9.2.13
  flutter_svg: ^1.1.6
  flutter_video_info: ^1.2.0
  flutter_zoom_drawer: ^3.0.3
  fluttertoast: ^8.1.2
  focus_detector_v2: ^3.1.0+1
  geocoding: ^2.0.5
  geolocator: ^9.0.2
  get: ^4.6.5
  # giphy_get: ^3.4.2
  google_fonts: ^4.0.4
  google_maps_flutter: ^2.2.1
  google_mobile_ads: ^2.0.0
  grouped_list: ^5.1.2
  image: ^4.0.17
  image_picker: ^1.0.1
  intl: ^0.18.0
  isar: ^3.1.0+1
  isar_flutter_libs: ^3.1.0+1
  just_audio: ^0.9.21
  latlong2: ^0.8.0
  light_compressor: ^1.2.2
  loading_indicator: ^3.1.0
  location_web: ^4.0.0
  logger: ^1.4.0
  maps_launcher: ^2.0.1
  maps_toolkit: ^2.0.1
  material_design_icons_flutter: ^7.0.7296
  material_floating_search_bar_2: ^0.5.0
  media_scanner: ^2.1.0
  mime: ^1.0.2
  octo_image: ^1.0.2
  open_filex: ^4.2.2
  package_info_plus: ^4.0.2
  path: ^1.8.0
  path_provider: ^2.0.7
  percent_indicator: ^4.0.0
  permission_handler: ^10.2.0
  phone_number: ^1.0.0
  photo_manager: ^2.2.1
  photo_view: ^0.13.0
  pin_code_fields: ^8.0.1
  pointycastle: ^3.5.2
  provider: ^6.0.4
  pull_to_refresh: ^2.0.0
  pusher_client: ^2.0.0
  random_password_generator: ^0.2.1
  rxdart: ^0.27.5
  scroll_to_index: ^3.0.1
  scrollable_positioned_list: 0.3.5
  share_plus: ^7.0.2
  shared_preferences: ^2.0.11
  shimmer: ^3.0.0
  simple_animations: ^5.0.0+2
  sliding_up_panel2: ^3.3.0
  smooth_star_rating_null_safety: ^1.0.4+2
  sqflite: ^2.0.0+4
  table_calendar: ^3.0.7
  throttling: ^1.0.0
  timeago: ^3.2.1
  timezone: ^0.9.1
  tutorial_coach_mark: ^1.2.4
  url_launcher: ^6.1.6
  uuid: ^3.0.7
  video_compress: ^3.1.1
  video_player: ^2.3.0
  video_thumbnail: ^0.5.3
  webview_flutter: ^4.2.2

dev_dependencies:
  build_runner: ^2.1.4
  flutter_launcher_icons: ^0.12.0
  flutter_test:
    sdk: flutter
  isar_generator: ^3.1.0+1
  mockito: ^5.0.17

what do you mean by "FlutterActivity" ? is there any config?

781flyingdutchman commented 11 months ago

Try deleting the pubspec.lock file, then in Android Studio File | Invalidate caches, then close and re-open Android studio then flutter clean, then pub get. Also, just to be sure: you cannot use the downloader from an Isolate, so if you do that this won't work. Hope this helps.

asfarul commented 11 months ago

sorry, still not working

asfarul commented 11 months ago

maybe because this plugin conflict with other plugin?

781flyingdutchman commented 11 months ago

That's what it looks like, but I've not heard about this issue before so if that is the case I'd like to know which one. When exactly does the error occur (eg right on startup or after you start using your app, it when you first use the downloader)? The error you pasted looks like it's cut from something: are there preceding log messages leading up to the crash?

asfarul commented 11 months ago

the error happens immediately when i run the app. there's no error log before the the one that i pasted

781flyingdutchman commented 11 months ago

Maybe a minSdk issue? I think you'll have to google the error messages specific to the plugins that generate the error -perhaps they'll give you a hint as to what may cause the issue. I understand it's suspicious the errors happen when you add the background_downloader, but there are no errors directly related to background_downloader and this issue has not come up before, so I am not sure I can help you - sorry.

vvhellohivv commented 11 months ago

Maybe a minSdk issue? I think you'll have to google the error messages specific to the plugins that generate the error -perhaps they'll give you a hint as to what may cause the issue. I understand it's suspicious the errors happen when you add the background_downloader, but there are no errors directly related to background_downloader and this issue has not come up before, so I am not sure I can help you - sorry.

i got the minSdk issue,some answer on google is not work.

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] commented 10 months ago

This issue was closed because it has been inactive for 7 days since being marked as stale.