-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Describe the bug
Hey guys :)
Looks like their might be a slight bug with the constructor new DFUFirmware(NSUrl urlToZipFile)
. When I try to use this function with any of the nugets >=0.2.17
, I get this error:
Foundation.MonoTouchException > Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[iOSDFULibrary.DFUFirmware initWithUrlToZipFile:]: unrecognized selector sent to instance 0x283e51220
To Reproduce
Steps to reproduce the behavior:
- Use the
new DFUFirmware(NSUrl urlToZipFile)
anywhere in an iOS app with the latest nuget packagev1.20.15
. Even if the file path doesn't point to a valid DFU file, it doesn't matter. E.g.new DFUFirmware(NSUrl.FromString("file:///var/somefileondevice.zip"));
- You should get an
Name: NSInvalidArgumentException Reason: -[iOSDFULibrary.DFUFirmware initWithUrlToZipFile:]: unrecognized selector sent to instance
error.
Expected behavior
The DFUFirmware
class instance gets created or throws another error like Invalid DFU file content
.
Additional context
Note that this works perfectly with v0.2.16-beta0012
. I think v0.2.17
included a change to a new version of the Nordic library as stated here.
It took me a while to track down this error to a possible bug in the Laerdal.Dfu
library. I had to make sure it wasn't an error in my project configuration.
If you look at the definition of the DFUFirmware
constructor in the Xamarin code:
And the in the ObjectiveC Binding:
And finally in the actual Nordic library:
It looks to me like the move from NSUrl
to the new Swift construct URL
may have broken the binding.
It's just a theory of course. It would be great if you guys could investigate and let me know if you find the issue. I'd love to jump on the v1.20.x
version which may be more stable and complete. At the same time, v0.2.16
works for our current needs so there is no rush.
Thanks again for this binding library.
Cheers