Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking Error When Running on Device #30

Closed
bwalpoleuk opened this issue May 10, 2019 · 4 comments
Closed

Linking Error When Running on Device #30

bwalpoleuk opened this issue May 10, 2019 · 4 comments

Comments

@bwalpoleuk
Copy link

Firstly let me say I can't be 100% sure that this issue is related to the Xamarin Swift4 packages but I'm not sure where else to go for help.

We are using the Xamarin Swift4 packages in conjunction with a Swift library that we have provided a binding for, everything is build fine but when we run the app on a device it crashes:

Termination Description: DYLD, Symbol not found: _$s15_ObjectiveCTypes01_A11CBridgeablePTl

I've attached the full crash report.

crash-report.txt

From what I understand of the error message we have some missing or conflicted assembly but I'm not sure of the best approach to debug it.

I've also included the contents of our packages.config so you can see the packages and versions we are using.

packages.txt

We are using Visual Studio for Mac 8.0.4.0 and XCode 10.1

@Flash3001
Copy link
Owner

Hey @bwalpoleuk, most likely your library was built using a different version of Xcode.

You can check that by opening the YOURLIBRARY-Swift.h file inside the framework and looking at the header, it says which version of Swift was used to compile. Then you can check your installed version by typing swift --version on your terminal (Swift 4.2.1 as it is the one that comes with Xcode 10.1).

If that is the case you have 2 options:
1 - Recompile your library using Xcode 10.1 and rebuild the binding.
2 - downgrade Xcode and the matching Swift packages on your Xamarin project.

Side note: You can remove all your Swift4 packages and replace with the https://www.nuget.org/packages/Xamarin.Swift/ as one of the benefits is that it does this exact check for you at compile time so you know beforehand if library and Xcode doesn't match.

@bwalpoleuk
Copy link
Author

bwalpoleuk commented May 10, 2019

@Flash3001 It appears to have been built using Swift 5

// Generated by Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)

Unfortunately its a 3rd party library so re-compiling it isn't an option.

@Flash3001
Copy link
Owner

Flash3001 commented May 10, 2019

It is even better, Swift 5 brings a lot of good changes. You can update your Xcode to 10.2 (or 10.2.1) and install the new Xamarin.Swift package (single package) - please be sure to test on iOS 11, if you only test on iOS 12.2 you can miss some issues.

@bwalpoleuk
Copy link
Author

Great! That fixed it, removing all the Swift 4 packages and installing the new single package https://www.nuget.org/packages/Xamarin.Swift/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants