Closed FilledStacks closed 2 years ago
Stuck on same
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.
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
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
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.
same problem
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'
Since we specify the version of device_info_plus directly, I just added this
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.
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
Could you provide exact steps to reproduce the issue?
If I do the following, I can compile the app without issues:
flutter pub add device_info_plus
All of that works.
In my case, i do not use device_info_plus itself, but it is a dependency for native_pdf_viewer which i import into my app (i use the lastest stable version of native_pdf_viewer).
Running flutter Pub upgrade did not change anything in my case. Azure pipeline still fails with the same error.
Thanks @Stachuu87 that helps.
I think the problem is that device_info_plus_platform_interface had a breaking change that was not provided inside a major version change. So apps depending on older versions of device_info_plus will break.
I will see if I can reproduce this issue and find a solution that doesn't break old clients.
I have reverted the breaking change in device_info_plus_platform_interface and republished under:
device_info_plus_platform_interface 2.5.0
device_info_plus_windows 3.0.3
device_info_plus 4.0.3
Please let me know if you still have the same issue
I have reverted the breaking change in device_info_plus_platform_interface and republished under:
device_info_plus_platform_interface 2.5.0 device_info_plus_windows 3.0.3 device_info_plus 4.0.3
Please let me know if you still have the same issue
It seems to work just fine for me. Thanks for such a quick response.
I have reverted the breaking change in device_info_plus_platform_interface and republished under:
device_info_plus_platform_interface 2.5.0 device_info_plus_windows 3.0.3 device_info_plus 4.0.3
Please let me know if you still have the same issue
@miquelbeltran
It doesn't work in my case.
It always gives error (Null check operator used on a null value)
.
This is the code:
class Device extends GetxController {
static final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
Future<Map<String, dynamic>> getDevice() async {
Map<String, dynamic>? map;
try {
if (Platform.isAndroid) {
map = _readAndroidBuildData(await deviceInfoPlugin.androidInfo);
} else if (Platform.isIOS) {
map = _readIosDeviceInfo(await deviceInfoPlugin.iosInfo);
}
} on PlatformException catch (e) {
map = {
"title": "Dart Package Failure",
"message": e.toString(),
"error": "Current dart package (device_info_plus) failed to get data.",
};
Get.offAll(() => AppError(title: map!['title'], message: map['message'], error: map['error']));
}
return map!;
}
Map<String, dynamic> _readAndroidBuildData(AndroidDeviceInfo build) {
return <String, dynamic>{
'version.securityPatch': build.version.securityPatch,
'version.sdkInt': build.version.sdkInt,
'version.release': build.version.release,
'version.previewSdkInt': build.version.previewSdkInt,
'version.incremental': build.version.incremental,
'version.codename': build.version.codename,
'version.baseOS': build.version.baseOS,
'board': build.board,
'bootloader': build.bootloader,
'brand': build.brand,
'device': build.device,
'display': build.display,
'fingerprint': build.fingerprint,
'hardware': build.hardware,
'host': build.host,
'id': build.id,
'manufacturer': build.manufacturer,
'model': build.model,
'product': build.product,
'supported32BitAbis': build.supported32BitAbis,
'supported64BitAbis': build.supported64BitAbis,
'supportedAbis': build.supportedAbis,
'tags': build.tags,
'type': build.type,
'isPhysicalDevice': build.isPhysicalDevice,
'systemFeatures': build.systemFeatures,
};
}
Map<String, dynamic> _readIosDeviceInfo(IosDeviceInfo data) {
return <String, dynamic>{
'name': data.name,
'systemName': data.systemName,
'systemVersion': data.systemVersion,
'model': data.model,
'localizedModel': data.localizedModel,
'identifierForVendor': data.identifierForVendor,
'isPhysicalDevice': data.isPhysicalDevice,
'utsname.sysname:': data.utsname.sysname,
'utsname.nodename:': data.utsname.nodename,
'utsname.release:': data.utsname.release,
'utsname.version:': data.utsname.version,
'utsname.machine:': data.utsname.machine,
};
}
}
This is the pubspec.yaml:
dependencies:
device_info_plus: 4.0.3
dependency_overrides:
device_info_plus: 4.0.3
device_info_plus_platform_interface: 2.5.0
Is there something wrong with github? Or dart pub.dev? This happens since today. It used to be okay. I replaced it with device_info_plus: 3.2.4 to 4.0.3, but it still gives same error as above.
If you see the image, you can know that the function really get the device data on the left stack, exactly on variable device
. This behavior is very strange. You can get the value of device, but it gives error (Null check operator used on a null value)
. I meant, I had removed "andoidId" when it got error. But, it still returned same error. I never changed any code inside this function. Why does it give that error? I never even replaced the variables.
This is the stack value:
#0 Cloud.checkDevice.<anonymous closure> (package:sim_had/library/controller/service/firebase.dart:517:15)
#1 Cloud.checkDevice.<anonymous closure> (package:sim_had/library/controller/service/firebase.dart:513:36)
#2 _rootRunUnary (dart:async/zone.dart:1434:47)
#3 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
<asynchronous suspension>
#4 Cloud.checkDevice (package:sim_had/library/controller/service/firebase.dart:513:7)
<asynchronous suspension>
#5 Cloud.signInWithGoogle.<anonymous closure> (package:sim_had/library/controller/service/firebase.dart:91:13)
<asynchronous suspension>
#6 Cloud.signInWithGoogle (package:sim_had/library/controller/service/firebase.dart:88:9)
<asynchronous suspension>
#7 SignIn.build.<anonymous closure> (package:sim_had/menu/signin.dart:35:17)
<asynchronous suspension>
Update: Sorry, the package is working up now. Since the error just appeared, I changed the variable and forgot that I had to copy data response from checkDevice to another late Map variable. So, sorry. I used the latest one: 4.1.0. No problem at all.
Thank you Flutter team.
Thank you Flutter team.
No worries!
Just to be clear, we are NOT part of the Flutter Team/Google/etc. and we are not sponsored by them in any way (or at least, I am not, lol). These plugins are run by independent volunteers on our free time, so we need both help and patience from the rest of the community to be able to do so.
Since this issue seems to be solved, I am closing the ticket now. Please for any new issues check the existing open tickers or open a new ticket.
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.
Code Sample
No response
Logs
Flutter Doctor