Flash3001/Xamarin.Swift

Not being able to deploy/debug on iOS versions prior to 12.2

arctouch-ricardodorta opened this issue · 8 comments

Hi, first of all thanks for this amazing package.
I noticed that when using Xamarin.Swift 1.0.2 Nuget Package and debugging on a device with iOS 12.2 or higher, my binding is working perfectly.
But when deploying to older versions of iOS 12.1 or prior, it breaks with a missing dylib message, in my case:

dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib

Im using PackageReference and I can see the _SwiftFrameworksMac target being executed in the build output.

I get an Installed version of 5.0.1 and I can see that the Native Framework im binding is on the list and has the swift header on the h file.

Any tip or step im missing to be able to deploy it to older versions of iOS?

Hey @arctouch-ricardodorta,

From the crash logs can you check which library is requesting libswiftAVFoundation.dylib ? Is it your binding or another Swift dylib?

This is important because after 12.2 everything works fine as iOS bundles Swift 5 with the OS so the runtime is always there. The only way to tell if it is falling is by running on older versions.

It is one of the libraries im binding.

Oh, and I fixed it for now by adding the libraries manually into the project in a Frameworks folder with a BundleResource action.

Only libswiftAVFoundation.dylib is missing or everything?

I think everything, if I add AVFoundation, it starts complaining about Core and so on...

It means that it is probably a setup issue and not an issue on the script itself. Can you set VS to Diagnostic build and share the entire _SwiftFrameworksMac Target log?

Shared the log with you in private

So, seems the problem was the library I was binding had an #if definition to split the headers to Simulators and Devices and that header did not have the swiftlang comment with the version. Workaround was adding the comment manually to the header and it worked as supposed to.