-
Notifications
You must be signed in to change notification settings - Fork 514
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
ios binding library with xcframework fails to link #21142
Comments
Can you try adding this to your main csproj: <PropertyGroup>
<LinkWithSwiftSystemLibraries>true</LinkWithSwiftSystemLibraries>
</PropertyGroup> That might only fix some of the errors, I think this will still cause problems:
you need to bind and link with the UnitySwiftProtobuf framework as well. Can you try that and see if it works? If not, please upload an updated binlog. |
I tried the LinkWithSwiftSystemLibraries to my project which didn't help and I couldn't find UnitySwiftProtobuf framework anywhere in my mac or in the internet. it seems that is an internal library that has been referenced in UnityAds and only is available inside the UnityAds binary. |
Can you get an updated binlog with this property set? |
Hi ,basically I get the same error but here are the updated binlog. I also want to share my csproj file.
|
Can you try adding the |
Hi, I have added the LinkWithSwiftSystemLibraries=true directly under element in my main csproj file, it seems the error has changed. I also added updated binlog.
|
Can you show your ApiDefinition.cs file as well? |
sure, here it is the ApiDefinition.cs ,but I haven't completed it yet
` |
I faced another issue with the binding library. the result that I said was only for simulator and the project works against simulator well but when I build against real ios device I get this error:
I tried several solutions including what is mentioned in #19115 and added following to my main project but it didn't help
and
the strange thing is that when I remove the binding library from project then everything works normal. |
That's really weird, and shouldn't happen. Can you get an updated binlog that shows this error? |
Here it is an updated binlog |
That's a bug in our code (filed as #21244). However, it's triggered by this line in your native reference: <LinkerFlags>-all_load</LinkerFlags> Which shouldn't be needed if your native library is a (dynamic) framework, so could you please try to remove this linker flag to see if that helps? |
I changed as you suggested now the build targeting the device works also, but the application crashes on startup in real device and works fine in simulator and visual studio reports nothing when it crashes. I am not sure if the problem is related to binding library itself. |
Can you see if there are any crash reports in Xcode (https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#crash-reports)? |
Hi @rolfbjarne , sorry I was on vacation, I see this in the logs in xcode
|
Looks like the app requires Swift libraries:
Try changing the value of the |
Thanks everything works now, I will try to put the project in GitHub for the others |
Apple platform
iOS
Framework version
net8.0-*
Affected platform version
VS2022 17.11.2
Description
I have built an Ios binding library with xcframework and I am using Unity Ads sdk for ios. the binding project compiles well without any error but when I try to use this library in my project at last step I get this error.
I am using visual studio on windows and paired it with Apple mac mini with M2 chip.
I also attached MsBuild binlog
Undefined symbols for architecture arm64: "_$s15_ObjectiveCTypes01_A11CBridgeablePTl", referenced from: l_got.$s15_ObjectiveCTypes01_A11CBridgeablePTl in UnityAds(UnityAds-arm64-master.o) "_$s16FloatLiteralTypes013ExpressibleByaB0PTl", referenced from: l_got.$s16FloatLiteralTypes013ExpressibleByaB0PTl in UnityAds(Google_Protobuf_Duration+Extensions.o) l_got.$s16FloatLiteralTypes013ExpressibleByaB0PTl in UnityAds(Google_Protobuf_Value+Extensions.o) l_got.$s16FloatLiteralTypes013ExpressibleByaB0PTl in UnityAds(Google_Protobuf_Wrappers+Extensions.o) "_$s17StringLiteralTypes013ExpressibleByaB0PTl", referenced from: l_got.$s17StringLiteralTypes013ExpressibleByaB0PTl in UnityAds(UnityAds-arm64-master.o) l_got.$s17StringLiteralTypes013ExpressibleByaB0PTl in UnityAds(Google_Protobuf_Value+Extensions.o) l_got.$s17StringLiteralTypes013ExpressibleByaB0PTl in UnityAds(Google_Protobuf_Wrappers+Extensions.o) "_$s17_StringProcessing14AnyRegexOutputVMn", referenced from: _symbolic _____y______GSg 17_StringProcessing5RegexV5MatchV AA03AnyC6OutputV in UnityAds(UnityAds-arm64-master.o) _symbolic _____y_____G 17_StringProcessing5RegexV AA03AnyC6OutputV in UnityAds(UnityAds-arm64-master.o) _symbolic _____y______G 17_StringProcessing5RegexV5MatchV AA03AnyC6OutputV in UnityAds(UnityAds-arm64-master.o) "_$s17_StringProcessing5RegexV10firstMatch2inAC0E0Vyx_GSgSS_tKF", referenced from: _$s8UnityAds19GatewayHashProviderC4hash3forSS10Foundation3URLV_tFTf4nd_n in UnityAds(UnityAds-arm64-master.o) "_$s17_StringProcessing5RegexV5MatchVMn", referenced from: _symbolic _____y______GSg 17_StringProcessing5RegexV5MatchV AA03AnyC6OutputV in UnityAds(UnityAds-arm64-master.o) _symbolic _____y______G 17_StringProcessing5RegexV5MatchV AA03AnyC6OutputV in UnityAds(UnityAds-arm64-master.o) "_$s17_StringProcessing5RegexVA2A03AnyC6OutputVRszlEyACyAEGSSKcfC", referenced from: _$s8UnityAds19GatewayHashProviderC4hash3forSS10Foundation3URLV_tFTf4nd_n in UnityAds(UnityAds-arm64-master.o) "_$s17_StringProcessing5RegexVMn", referenced from: _symbolic _____y_____G 17_StringProcessing5RegexV AA03AnyC6OutputV in UnityAds(UnityAds-arm64-master.o) "_$s18BooleanLiteralTypes013ExpressibleByaB0PTl", referenced from: FantasyFighterIos C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net8.0_17.5\17.5.8020\targets\Xamarin.Shared.Sdk.targets 1641
Steps to Reproduce
built an Ios binding library with xcframework
use binding library in your ios project
use remote M2 chip mac to build your project
Did you find any workaround?
No
Build logs
CentralNode_devenv_PID=25024_x64_BuildManager_Default.zip
The text was updated successfully, but these errors were encountered: