faithoflifedev / easy_onvif_workspace

This package works with a variety of ONVIF compatible devices allowing for IP Cameras and NVRs (network video recorders) to be integrated into Dart and Flutter applications.
32 stars 19 forks source link

Unhandled exception: type 'Null' is not a subtype of type 'String' calling Onvif.connect #28

Closed LODYZ closed 1 year ago

LODYZ commented 1 year ago

Hi, i am using the ^2.0.13+17 version but when i try to call the method Onvif.connect i get this error:

Unhandled exception: type 'Null' is not a subtype of type 'String'

0 OnvifUtil.mappedToString (package:easy_onvif/src/util/util.dart:142:68)

1 _$TimeZoneFromJson (package:easy_onvif/src/model/time_zone.g.dart:10:21)

2 new TimeZone.fromJson (package:easy_onvif/src/model/time_zone.dart:18:7)

3 _$SystemDateAndTimeFromJson (package:easy_onvif/src/model/system_date_and_time.g.dart:17:22)

4 new SystemDateAndTime.fromJson (package:easy_onvif/src/model/system_date_and_time.dart:43:7)

5 _$GetSystemDateAndTimeResponseFromJson (package:easy_onvif/src/model/system_date_time_response.g.dart:12:25)

6 new GetSystemDateAndTimeResponse.fromJson (package:easy_onvif/src/model/system_date_time_response.dart:18:7)

7 _$BodyFromJson (package:easy_onvif/src/model/body.g.dart:43:42)

8 new Body.fromJson (package:easy_onvif/src/model/body.dart:214:55)

9 _$EnvelopeFromJson (package:easy_onvif/src/model/envelope.g.dart:10:18)

10 new Envelope.fromJson (package:easy_onvif/src/model/envelope.dart:20:7)

11 new Envelope.fromXml (package:easy_onvif/src/model/envelope.dart:23:16)

12 Soap.retrieveEnvelope (package:easy_onvif/src/soap.dart:67:21)

#13 DeviceManagement.getSystemDateAndTime (package:easy_onvif/src/device_management.dart:150:22) #14 Onvif.initialize (package:easy_onvif/src/onvif_base.dart:96:22) #15 Onvif.connect (package:easy_onvif/src/onvif_base.dart:87:5) #16 OnvifHelperCommand.initializeOnvif (package:easy_onvif/cmd/onvif_helper_command.dart:28:14) #17 OnvifGetDeviceInformationResponseDeviceManagementCommand.run (package:easy_onvif/cmd/onvif_device_management_command.dart:68:5) #18 CommandRunner.runCommand (package:args/command_runner.dart:209:13) I am attaching the whole log in the hope that it will be useful for solving the problem. πŸ‘» 23:37:45.306368 INFO UI Loggy - Onvif - initializing ... πŸ› 23:37:45.309145 DEBUG UI Loggy - DeviceManagement - getSystemDateAndTime πŸ› 23:37:45.323206 DEBUG UI Loggy - Onvif - URI: http://192.168.0.25/onvif/device_service πŸ› 23:37:45.323269 DEBUG UI Loggy - Onvif - REQUEST: πŸ› 23:37:45.577436 DEBUG UI Loggy - Onvif - RESPONSE: NTPfalse2237452022122622374520221226 Any idea why I'm getting this? Thank you in advance
faithoflifedev commented 1 year ago

Hello @LODYZ ,

The latest version is now easy_onvif: ^2.0.13+19, please let me know if this resolves the problem above.

LODYZ commented 1 year ago

Hello @faithoflifedev,

I just tried with the latest version and I don't get the error anymore! Thank you.

Unfortunately I'm getting another error that seems to be related to: https://github.com/faithoflifedev/easy_onvif/issues/30 I wrote a comment there