Skip to content

[iOS] Invalid mapping for DFUFirmware constructor #14

@SuperCorks

Description

@SuperCorks

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:

  1. Use the new DFUFirmware(NSUrl urlToZipFile) anywhere in an iOS app with the latest nuget package v1.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"));
  2. 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:
image

And the in the ObjectiveC Binding:
image

And finally in the actual Nordic library:
image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions