Open DimaOrdenov opened 1 week ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Tagging subscribers to this area: @dotnet/interop-contrib See info in area-owners.md if you want to be subscribed.
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.
Description
I am trying to migrate from Xamarin Native project to .NET (Android and iOS). I have a project MAIN that works fine with the following TargetFrameworks
<TargetFrameworks>MonoAndroid12.0;Xamarin.iOS10;net5.0</TargetFrameworks>
, but strange issue occurs after migrating to<TargetFrameworks>net7.0;net7.0-ios;net7.0-android</TargetFrameworks>
(it will be .net8 or higher after successful migration to .NET at all). Project MAIN is a wrapper for c++ libraries. To be more correct, there are two projects project MAIN depends on: project Android which references c++ library in .so format; project iOS which references c++ library in binary format. I am not sure if iOS library format is .a library format or something else as it provided by a partner as 'pure' binary without extension. I have methods with DllImport attributes in the project MAIN. Also project MAIN contains structs, handlers and other used definitions for a C++ header file. As far as I am running the app under Xamarin framework everything works fine. It's able to use all needed methods. But when I change the framework to .NET some methods break. To be more precise, I'll show methods which work and which are not. This is all Utf8String methods and structs I am using:C++
C#
Utf8String successfully works for the following method and struct
C++
C#
But this method breaks after changing Xamarin to .NET
C++
C#
By 'breaks' I mean that the library throws an error that created
Rtc360_Utf8StringHandle
passed by argumentname
do not persist in the library. However, the library logs the created handle during the creation process (logging happens inside ofRtc360_Utf8String_New
and passed argumentRtc360_Utf8StringHandle name
in the error message. They are different. I've made a call with the partner and he said that there is no special logic that could change the string handle inside ofRtc360_DataManipulationWorkflow_SetJobName
. Also, as I've said, it works for Xamarin.Where I can search the answers? Maybe I can try to 'play' with marshalling? I've tried to use LibraryImport attribute but no success. Maybe there were changes in marshalling? Should I take a look at other projects in my solution?
Feel free to request more info so I could explain the details better.
Steps to Reproduce
Steps to reproduce probably will be 'unprovidable' as I have internal SDK (binary libraries files) and the app. But I am open for any further communications. We also can make a private debug session if needed.
Link to public reproduction project repository
No response
Version with bug
.NET 7
Is this a regression from previous behavior?
Yes, this used to work in Xamarin Native
Last version that worked well
Xamarin latest
Affected platforms
iOS, Android
Affected platform versions
Doesn't matter
Did you find any workaround?
No workaround
Relevant log output
No response