-
Notifications
You must be signed in to change notification settings - Fork 520
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
Native Linking Fails For Release Builds, Even When Linker Is Off #10855
Comments
The managed linker (don't link, link sdk and link all) is not the same as the native linker (Apple toolchain). Your errors comes from the latter. Both are largely unrelated - but if the managed linker can remove something then it's not present later to cause (potential) issues. That's why you're seeing less errors when increasing the use of the managed linker. IOW it does not fix the issues, its just remove the offending piece of code.
Yes, that't the key information here. Other symbol/libraries names suggest native Windows API (p/invokes).
I suspect something else (e.g. nuget) was updated and you are now referencing a Windows (e.g. .net desktop) assembly instead of a NETStandard2.x assembly (or one built against the Xamarin.iOS SDK).
Is it possible the errors are older than you thought ? E.g. You might have been using debug builds for a while and not notice the problem. Try to compare your build options between the Release and Debug configurations. If nothing stands out please attach the working logs too. |
@spouliot Thanks for the advice and the info about the native and managed linker. I was not aware of the difference, so its nice to get some more insight into how it all works 🙂 I'll have a look for windows references, it could possibly be coming from my controls library which uses multi-targeting. What is strange is that I noticed this failure on my build pipeline which has worked for months and suddenly broken this week. I can categorically confirm i've been building it for release because my final ipa's are 1/4 the size of the debug builds. I'll have a look and report back! |
I've been able to reproduce the issue in a seperate project. The offending library is |
I've removed the |
After updating to 14.14, I get the following linking errors, which seems related to this issue:
No dependencies have changed. Is 14.14. just surfacing a pre-existing bad reference? |
Turns out a reference to the |
Same issue with 14.14.2.5, build was working with 14.8.0.3. |
This is probably a me issue, however I've noticed my release builds have stopped working. I've tried rolling back to a commit i've previously built and released but the issue is persisting so I'm wondering if there is something else going on
Steps to Reproduce
Expected Behavior
The app builds and runs
Actual Behavior
The build fails, all errors are related to the linker. The errors are different depending on the linker settings, I've provided a table of behaviours below:
DryIoc.ContainerException: code: Error.RegisteringImplementationNotAssignableToServiceType;
All of the warnings and errors following the general format:
Errors:
Error MT5210: Native linking failed, undefined symbol: $(SYMBOL). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Warnings:
Warning MT5215: References to '$(SYMBOL)' might require additional -framework=XXX or -lXXX instructions to the native linker (MT5215)
I have enabled the verbose build output, I'm not well versed in these logs but I did spot the following output:
I've provided build logs below, obfuscating details of my machine
Environment
Build Logs
Complete build logs here
Example Project (If Possible)
Not possible to provide the source code, sorry 🙁
As an aside, I'm happy if you close this as a non issue but I'm interested to know if this is an issue with my Xamarin.iOS version. I am unable to build a commit that I have previously built and released. Would you be able to provide me with a Xamarin.iOS version to downgrade to for testing?
When I see this warning
Warning MT5215: References to 'kernel32' might require additional -framework=XXX or -lXXX instructions to the native linker (MT5215)
I wonder why on earth my app is trying to reference kernel32!!Update 1:
I tested applying the linker to debug builds and they work fine, both link sdk & all will result in a successful build and a runnable app.
The text was updated successfully, but these errors were encountered: