Skip to content

[Bug]: Device Info Plus not building anymore #1000

Closed
@FilledStacks

Description

@FilledStacks

Platform

Android

Plugin

device_info_plus

Version

^3.2.3

Flutter SDK

3.0.5

Steps to reproduce

Try to run the app after doing flutter pub upgrade

I get the example.

../../../../src/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus_windows-2.1.1/lib/src/device_info_plus_windows.dart:24:35: Error: Required named parameter 'userName' must be provided.
    final data = WindowsDeviceInfo(
                                  ^
../../../../src/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus_platform_interface-2.4.0/lib/model/windows_device_info.dart:12:3: Context: Found this candidate, but the arguments don't match.
  WindowsDeviceInfo({
  ^^^^^^^^^^^^^^^^^

Code Sample

No response

Logs

../../../../src/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus_windows-2.1.1/lib/src/device_info_plus_windows.dart:24:35: Error: Required named parameter 'userName' must be provided.
    final data = WindowsDeviceInfo(
                                  ^
../../../../src/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus_platform_interface-2.4.0/lib/model/windows_device_info.dart:12:3: Context: Found this candidate, but the arguments don't match.
  WindowsDeviceInfo({
  ^^^^^^^^^^^^^^^^^

Flutter Doctor

[✓] Flutter (Channel stable, 3.0.5, on macOS 12.3.1 21E258 darwin-arm, locale en-ZA)
    • Flutter version 3.0.5 at /Users/danemackier/src/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (4 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/danemackier/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.70.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.46.0

[✓] Connected device (3 available)
    • SM G960F (mobile) • 2223cc1a36057ece • android-arm64  • Android 10 (API 29)
    • macOS (desktop)   • macos            • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 103.0.5060.134

[✓] HTTP Host Availability
    • All required HTTP hosts are available

Activity

GauravCalidig

GauravCalidig commented on Aug 8, 2022

@GauravCalidig

Stuck on same

image

FilledStacks

FilledStacks commented on Aug 8, 2022

@FilledStacks
Author

Anyone have a workaround yet? I'm trying to do dependency overrides but nothing is making it pass.

If you find a version that works please post, I have an urgent build to get out.

GauravCalidig

GauravCalidig commented on Aug 8, 2022

@GauravCalidig

If it's urgent, As a quick workaround you can comment the code giving error. if you are not building a windows app it should work fine @FilledStacks
image

FilledStacks

FilledStacks commented on Aug 8, 2022

@FilledStacks
Author

If it's urgent, As a quick workaround you can comment the code giving error. if you are not building a windows app it should work fine @FilledStacks image

Thanks. This works locally. Not when I try and make a release to QA through our CI pipeline. I'll remove the package for now and add it back when this is fixed.

Thanks for the response.

sara010

sara010 commented on Aug 8, 2022

@sara010

same problem

ryzizub

ryzizub commented on Aug 8, 2022

@ryzizub

I temporary added overrides to pubspec.yaml, seems to work pretty well :)

dependency_overrides:
  device_info_plus: '4.0.0'
  device_info_plus_platform_interface: '2.3.0+1'
xrandy00

xrandy00 commented on Aug 8, 2022

@xrandy00

Since we specify the version of device_info_plus directly, I just added this
image

ixre

ixre commented on Aug 8, 2022

@ixre

Edit file device_info_plus_windows/lib/src/device_info_plus_windows.dart like this

 @override
  Future<WindowsDeviceInfo> windowsInfo() {
    return Future.value(null);
  }

now, i have avoid it temporarily.

M123-dev

M123-dev commented on Aug 8, 2022

@M123-dev

We had the same problem. After upgrading to ^4.0.2 it seems to be fixed.
Tests as well as local debug building works again

miquelbeltran

miquelbeltran commented on Aug 10, 2022

@miquelbeltran
Member

Could you provide exact steps to reproduce the issue?

If I do the following, I can compile the app without issues:

  • Create a flutter project
  • add the device_info_plus dependency with flutter pub add device_info_plus
  • Run the project on Android

All of that works.

20 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @miquelbeltran@gOzaru@FilledStacks@ixre@xrandy00

        Issue actions

          [Bug]: Device Info Plus not building anymore · Issue #1000 · fluttercommunity/plus_plugins