Closed SuperCorks closed 3 years ago
Hi @SuperCorks,
Thank you for testing it and for the Log 👍. I see where it comes from and reproduced it. I'll release an updated version with this fixed soon.
Epic François, thanks a lot!
Okay just pushed v4.9.0.7. Let me know :)
Hello @framinosona , many thanks for your package. I have followed the issue and saw the update but unfortunately I am facing similar errors as @SuperCorks with 4.9.0.7 version.
Sorry to say that 4.9.0.7 has indeed not fixed it.
17>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(711,3): error MT5211: Native linking failed, undefined Objective-C class: DFUFirmware. The symbol '_OBJC_CLASS_$_DFUFirmware' could not be found in any of the libraries or frameworks linked with your application.
17>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(711,3): error MT5211: Native linking failed, undefined Objective-C class: DFUFirmwareSize. The symbol '_OBJC_CLASS_$_DFUFirmwareSize' could not be found in any of the libraries or frameworks linked with your application.
17>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(711,3): error MT5211: Native linking failed, undefined Objective-C class: DFUPeripheralSelector. The symbol '_OBJC_CLASS_$_DFUPeripheralSelector' could not be found in any of the libraries or frameworks linked with your application.
17>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(711,3): error MT5211: Native linking failed, undefined Objective-C class: DFUServiceController. The symbol '_OBJC_CLASS_$_DFUServiceController' could not be found in any of the libraries or frameworks linked with your application.
17>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(711,3): error MT5211: Native linking failed, undefined Objective-C class: DFUServiceInitiator. The symbol '_OBJC_CLASS_$_DFUServiceInitiator' could not be found in any of the libraries or frameworks linked with your application.
17>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(711,3): error MT5211: Native linking failed, undefined Objective-C class: DFUUuid. The symbol '_OBJC_CLASS_$_DFUUuid' could not be found in any of the libraries or frameworks linked with your application.
17>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(711,3): error MT5211: Native linking failed, undefined Objective-C class: DFUUuidHelper. The symbol '_OBJC_CLASS_$_DFUUuidHelper' could not be found in any of the libraries or frameworks linked with your application.
Yep, investigating still :/ Sorry about that. First, I know that I was missing [Protocol] on those classes, but now that this is fixed when trying to use them, I get "ObjCRuntime.RuntimeException: Can't register the class Laerdal.Xamarin.Dfu.iOS.DFUFirmware when the dynamic registrar has been linked away." so I'm trying to fix that now.
No worries, let us know if you need any help. I haven't worked with binding libraries much, but I know there's a [PreserveAll]
tag that could maybe help avoid things getting linked out.
Also, maybe adding the following mtouch argument: --optimize=-remove-dynamic-registrar
(notice the -
before remove
)
Yep tried the Preserve all and it didn't change that, the --optimize=-remove-dynamic-registrar could work but it would require people who use that nuget to have to add it to their project, I'm trying to prevent that. It worked before and I think it has to do with my "objective sharpie" operation. On previous versions my classes had generated names like "TtP13iOSDFULibrary29DFUPeripheralSelectorDelegate" and now my Objective sharpie doesn't generate them ... I remember that a year ago I had come up with a couple of convenient regex to change the iOS Framework .h file before sharpifying them... I'm digging through archives :)
Found it! Before building the iOS (xcode) project I need to run:
https://regex101.com/r/li9ll8/1
Okay I'll try that and send a new package if it works :)
OKAY ! This one should be the right one :)
https://www.nuget.org/packages/Laerdal.Xamarin.Dfu.iOS/4.9.0.11
I've tested without adding --optimize=-remove-dynamic-registrar or anything, just the Nuget and it worked. Let me know :) @SuperCorks and @Moret84
Works on my side. Thanks a lot François! Cheers!
This is back again in 4.9.0.14
Hey guys,
First of all, thank you for this. It saved me a lot of time! 🙏
I've been using the older NuGet (the one that started with Xamarin) without any issue. Today I changed to the new NuGet package (the one that starts with Laerdal), but when I build I get linker issues (see logs below).
The package is wrapped in an iOS library project, so it's imported in there. I've also imported it in the iOS app project (not sure if I had to do that). Tried to build with linker behaviors: Link All, and Don't Link
Is there anything I'm missing?
Using: Xamarin 4.8.0.1821 Laerdal.Xamarin.Dfu.iOS 4.9.0.6 Visual Studio Community 2019 16.8.3
Build logs:
I can send you a minimal replication project if you ask for it.