plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Bug]: type 'BaseDeviceInfo' is not a subtype of type 'LinuxDeviceInfo' in type cast

Open Holofox opened this issue 2 years ago • 8 comments

Platform

Linux

Plugin

device_info_plus

Version

8.1.0

Flutter SDK

3.7.3

Steps to reproduce

When running tests in Gitlab CI, I encounter a type mismatch error for Linux.

Code Sample

await DeviceInfoPlugin().linuxInfo;

Logs

{"testID":41,"error":"type 'BaseDeviceInfo' is not a subtype of type 'LinuxDeviceInfo' in type cast","stackTrace":"package:device_info_plus/device_info_plus.dart 71:36  DeviceInfoPlugin.linuxInfo\n","isFailure":false,"type":"error","time":181529}
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.0 22A380 darwin-x64, locale ru-RU)
    • Flutter version 3.7.3 on channel stable at /Volumes/Development/FVM/3.7.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9944297138 (11 days ago), 2023-02-08 15:46:04 -0800
    • Engine revision 248290d6d5
    • Dart version 2.19.2
    • DevTools version 2.20.1

[✓] IntelliJ IDEA Ultimate Edition (version 2022.2.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 72.1.3
    • Dart plugin version 222.4533

Checklist before submitting a bug

  • [X] I Google'd a solution and I couldn't find it
  • [X] I searched on StackOverflow for a solution and I couldn't find it
  • [X] I read the README.md file of the plugin
  • [X] I'm using the latest version of the plugin
  • [X] All dependencies are up to date with flutter pub upgrade
  • [X] I did a flutter clean
  • [X] I tried running the example project

Holofox avatar Feb 20 '23 09:02 Holofox

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar May 22 '23 00:05 github-actions[bot]

@nohli please reopen. This issue does still exist in device_info_plus 9.1.0. See https://github.com/wiredashio/wiredash-sdk/actions/runs/6851936895/job/18629323933?pr=305

passsy avatar Nov 13 '23 15:11 passsy

Thanks for reporting this @Holofox and @passsy 🙏🏽

nohli avatar Nov 13 '23 15:11 nohli

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Feb 12 '24 00:02 github-actions[bot]

I cannot reproduce this issue with 9.1.2. Is this still happening?

miquelbeltran avatar Feb 12 '24 07:02 miquelbeltran

I also can't reproduce it with Flutter 3.7+ and device_info_plus 9.1.2.

But I can reproduce it with (testing PR)

  • Flutter 3.3.10 and device_info_plus 9.1.2
  • Flutter 3.0.0 and device_info_plus 8.2.2

passsy avatar Feb 12 '24 10:02 passsy

Sorry, I am not able to see it in the logs. I cannot find LinuxDeviceInfo in them.

My only idea is that if some reason using an old Flutter version pulls an incompatible sub-package i.e. a version of device_info_plus and a version of device_info_plus_package_interface that are truly not compatible.

e.g. some changes from the past: https://github.com/fluttercommunity/plus_plugins/commit/e72efb25e2deba53e6cd9c339727a76e12bf99e4#diff-fe1c35f8306be6e8c1694eaf8fdf10a27b0bdbeb8082019b74457fe13191730f

Can you share the pubspec.lock when running on 3.3.10 to see which versions are used?

e.g. from my project

  device_info_plus:
    dependency: "direct main"
    description:
      name: device_info_plus
      sha256: "77f757b789ff68e4eaf9c56d1752309bd9f7ad557cb105b938a7f8eb89e59110"
      url: "https://pub.dev"
    source: hosted
    version: "9.1.2"
  device_info_plus_platform_interface:
    dependency: transitive
    description:
      name: device_info_plus_platform_interface
      sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64
      url: "https://pub.dev"
    source: hosted
    version: "7.0.0"

miquelbeltran avatar Feb 12 '24 11:02 miquelbeltran

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar May 13 '24 00:05 github-actions[bot]