-
Notifications
You must be signed in to change notification settings - Fork 507
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 binding to NSString
returns null
#20061
Comments
I can reproduce this. As a workaround you can add this to your consuming csproj: <PropertyGroup>
<_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
</PropertyGroup> |
…cute. Fixes xamarin#20061. Missing: a test. Fixes xamarin#20061.
Apparently it only helps with the simulator build. When I deploy the app the a real device, those fields remain null. It may be a different issue though, because in this case switching to .NET 7 doesn't help either. Any thoughts on a workarounds that would work for a device? |
Try adding the following to your csproj: <PropertyGroup>
<_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
<NoSymbolStrip>true</NoSymbolStrip>
</PropertyGroup>
<ItemGroup>
<_MainLinkerFlags Include="-u" />
<_MainLinkerFlags Include="_PLCrashReporterException" />
</ItemGroup> |
…cute. Fixes xamarin#20061. Missing: a test. Fixes xamarin#20061.
Steps to Reproduce
Get a static
.a
library that has anNSString
field in code:NSString *Foo = @"Bar";
.Create an iOS binding project that binds to the static lib and to the field:
Create a .NET 8 iOS project that would reference the binding project.
Log
Constants.Foo
.Expected Behavior
Constants.Foo
returns"Bar"
.Actual Behavior
Constants.Foo
returnsnull
.If we change the target framework of the consumer project from .NET 8 to .NET 7,
"Bar"
is returned as expected. Also, from what I can see, it doesn't matter if the binding project is .NET 7 or .NET 8.Environment
.NET 8.0.101
iOS workload 17.2.8004/8.0.100
XCode 15.2
iOS Simulator with iOS 17.2
macOS Sonoma 14.3
Apple Silicon M1
Build Logs
log.binlog.zip
Example Project
https://github.com/akravch/IosNet8Binding
I bind to https://github.com/microsoft/plcrashreporter/releases/tag/1.11.1 and log
PLCrashReporterException
field.I chose the PLCrashReporter library simply because it was the first thing that came to my mind I could find already compiled, but the behavior is the same regardless of the library.
The text was updated successfully, but these errors were encountered: