sdk-for-flutter icon indicating copy to clipboard operation
sdk-for-flutter copied to clipboard

🐛 Bug Report: device_info_plus_windows-2.1.1 Error: Required named parameter 'userName' must be provided.

Open Chandram-Dutta opened this issue 2 years ago • 4 comments

👟 Reproduction steps

Running the app on android and linux is causing error and not building the app

👍 Expected behavior

it shouldnt crash and the app should build and run

👎 Actual Behavior

Screenshot from 2022-08-10 14-52-38


On Android

Launching lib/main.dart on RMX3461 in debug mode... lib/main.dart:1 : Error: Required named parameter 'userName' must be provided. ../…/src/device_info_plus_windows.dart:24 final data = WindowsDeviceInfo( ^ : Context: Found this candidate, but the arguments don't match. ../…/model/windows_device_info.dart:12 WindowsDeviceInfo({ ^^^^^^^^^^^^^^^^^ FAILURE: Build failed with an exception.

  • Where: Script '/home/chandramlinux/SDK/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1156

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command '/home/chandramlinux/SDK/flutter/bin/flutter'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 5s

Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)


On Linux

Launching lib/main.dart on Linux in debug mode... lib/main.dart:1 ERROR: ../../SDK/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. ../…/src/device_info_plus_windows.dart:24 ERROR: final data = WindowsDeviceInfo( ERROR: ^ ERROR: ../../SDK/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. ../…/model/windows_device_info.dart:12 ERROR: WindowsDeviceInfo({ ERROR: ^^^^^^^^^^^^^^^^^ Exception: Build process failed

Exited (sigterm)

🎲 Appwrite version

Version 2.0.x

💻 Operating system

Linux

🧱 Your Environment

Appwrite: ^6.0.0

👀 Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Chandram-Dutta avatar Aug 10 '22 09:08 Chandram-Dutta

@Chandram-Dutta, thanks for raising this issue! 🙏

@lohanidamodar, does the following PR fix this?

  • https://github.com/appwrite/sdk-generator/pull/510

stnguyen90 avatar Aug 10 '22 15:08 stnguyen90

@stnguyen90 @Chandram-Dutta Yes this fixes the issue, will publish the fix soon. For now if you are stuck, you should be able to override the dependency and solve the issue by adding the following in your project's pubspec.yaml file

dependency_overrides:
  device_info_plus: ^4.0.3
  package_info_plus: 1.4.3

Let me know if this works or not

lohanidamodar avatar Aug 11 '22 00:08 lohanidamodar

@lohanidamodar

device_info_plus: ^4.0.3

Getting this error on using device_info_plus: ^4.0.3

Because device_info_plus >=4.0.3 depends on device_info_plus_windows ^3.0.3 and no versions of device_info_plus_windows match >3.0.3 <4.0.0, device_info_plus >=4.0.3 requires device_info_plus_windows 3.0.3. And because device_info_plus_windows 3.0.3 depends on ffi ^2.0.1, device_info_plus >=4.0.3 requires ffi ^2.0.1. And because package_info_plus >=1.4.1 <1.4.3 depends on package_info_plus_windows ^1.0.5 which depends on ffi ^1.0.0, device_info_plus >=4.0.3 is incompatible with package_info_plus >=1.4.1 <1.4.3. And because appwrite 6.0.0 depends on package_info_plus 1.4.2 and no versions of appwrite match >6.0.0 <7.0.0, device_info_plus >=4.0.3 is incompatible with appwrite ^6.0.0. So, because appwrite_testing depends on both appwrite ^6.0.0 and device_info_plus ^4.0.3, version solving failed. pub get failed (1; So, because appwrite_testing depends on both appwrite ^6.0.0 and device_info_plus ^4.0.3, version solving failed.) exit code 1


On using

dependency_overrides: device_info_plus: ^4.0.2 package_info_plus: 1.4.3

Its working without any issue.

Chandram-Dutta avatar Aug 11 '22 05:08 Chandram-Dutta

makes sense, as those had common dependencies.

lohanidamodar avatar Aug 11 '22 06:08 lohanidamodar