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
.NET 8 IOS Native Binding XcFramework (Static library Wrapper) FAILED #20195
Comments
I can reproduce the problem. The correct Kind value is Can you try adding the following to the test app's csproj to see if it fixes the problem for you? <ItemGroup>
<_CustomLinkFlags Include="-u" />
<_CustomLinkFlags Include="_OBJC_CLASS_$_NetworkDiscoverer" />
<_CustomLinkFlags Include="-u" />
<_CustomLinkFlags Include="_OBJC_CLASS_$_PrinterStatus" />
<_CustomLinkFlags Include="-u" />
<_CustomLinkFlags Include="_OBJC_CLASS_$_TcpPrinterConnection" />
<_CustomLinkFlags Include="-u" />
<_CustomLinkFlags Include="_OBJC_CLASS_$_ZebraPrinterFactory" />
</ItemGroup> |
Note to self: The problem is that xamarin-macios/tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs Lines 149 to 153 in 69bb4ac
The HasLinkWithAttribute property is set here: xamarin-macios/tools/common/Assembly.cs Line 239 in 69bb4ac
but that's not hit, becuase there's a binding resource package for the assembly, so this code path prevents it: |
Hi, Thanks for the help. I currently successfully ran the test program. Since we are upgrading a big project form .Net 7 (built by VS Mac), we are facing a lot of same nativebinding library issues. Are we supposed to put all those exposed interface as the same format into project ("OBJ_CLASS.xxxx")? Or should we wait for next patch fix this bug? (when will this fix be available?) |
I can't say how long it'll take to fix this, so I believe your best approach would be to implement the workaround for all Objective_C interfaces. |
Thanks a lot. error : clang++ exited with code 1: Do i need to create another ticket? or this can be fixed by the same solution (adding OBJ reference in csproject itemgroups)? |
Please create a new issue, it may or may not have the same solution, and in case it doesn't, it'll get very confusing here (it's much easier to merge two separate issues than to split one issue in two later on). |
Is this covered by issue #19624? [I think not, since the symptom is different.] I am having the same problem. |
Note to self: this might have been fixed with #20479. |
When in doubt, it's always safe to file a new issue :) It might the be same problem as this issue, but I can't say without a test project I can use to reproduce the problem. |
Steps to Reproduce
Expected Behavior
The native library should be linked using different platform library and run at all platforms and build configurations.
Actual Behavior
1, when the Binding project's setting set "Static", the project can be built but when running , throw exception of " the native class hasn't been loaded".
2, when the Binding project's setting set "Framework", the project can't build successfully, with a error: "framework not found ios-arm64_x86_64-simulator", Clang++ exit
Environment
Microsoft Visual Studio Professional 2022
Version 17.9.0
VisualStudio.17.Release/17.9.0+34607.119
Microsoft .NET Framework
Version 4.8.09032
Installed Version: Professional
ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools
ASA Service Provider 1.0
ASP.NET and Web Tools 17.9.195.45391
ASP.NET and Web Tools
Automatic Versions 3.1.1
Provides tools for managing assembly versions.
Azure App Service Tools v3.0.0 17.9.195.45391
Azure App Service Tools v3.0.0
Azure Data Lake Tools for Visual Studio 2.6.5000.0
Microsoft Azure Data Lake Tools for Visual Studio
Azure Functions and Web Jobs Tools 17.9.195.45391
Azure Functions and Web Jobs Tools
Azure Stream Analytics Tools for Visual Studio 2.6.5000.0
Microsoft Azure Stream Analytics Tools for Visual Studio
C# Tools 4.9.0-3.24081.11+989117396f26e5453ff157df610d22ce45b6b0a9
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.4.39 (main@e8108eb)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
Microsoft Azure Hive Query Language Service 2.6.5000.0
Language service for Hive query
Microsoft Azure Stream Analytics Language Service 2.6.5000.0
Language service for Azure Stream Analytics
Microsoft Azure Tools for Visual Studio 2.9
Support for Azure Cloud Services projects
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Mono Debugging for Visual Studio 17.9.0 (b3bca6f)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 6.9.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Razor (ASP.NET Core) 17.9.2.2408002+5aec2f1744a2273d3e7157cc4cc1986f87f524d4
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.9.51.1
Microsoft SQL Server Data Tools
ToolWindowHostedEditor 1.0
Hosting json editor into a tool window
TypeScript Tools 17.0.30103.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.9.0-3.24081.11+989117396f26e5453ff157df610d22ce45b6b0a9
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.9.0-beta.23614.3+a521e1cd420beb56c15faf6836184fadd2b7937a
Microsoft Visual F# Tools
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
VisualStudio.DeviceLog 1.0
Information about my package
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
VSPackage Extension 1.0
VSPackage Visual Studio Extension Detailed Info
Xamarin 17.9.0.138 (d17-9@60c2b9b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 17.9.3.0 (remotes/origin/d17-9@f174974f91)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin.Android SDK 13.2.2.0 (d17-5/45b0e14)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: d9a6e87
Java.Interop: xamarin/java.interop@149d70fe
SQLite: xamarin/sqlite@68c69d8
Xamarin.Android Tools: xamarin/xamarin-android-tools@ca1552d
Build Logs
iOSApp2_Debug_AnyCPU_Build_2024-02-24T18_57_30.6147050-08_00.zip
Example Project (If Possible)
https://github.com/gnibloop/Net8NativeBindingTest
The text was updated successfully, but these errors were encountered: