You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
By 'breaks' I mean that the library throws an error that created Rtc360_DataManipulationWorkflow_SetJobName passed by argument name do not persist in the library. However, the library logs the created handle (using Rtc360_Utf8String_New) during the creation process and passed argument Rtc360_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 of Rtc360_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
The text was updated successfully, but these errors were encountered:
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!
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_DataManipulationWorkflow_SetJobName
passed by argumentname
do not persist in the library. However, the library logs the created handle (usingRtc360_Utf8String_New
) during the creation process 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 of
Rtc360_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
The text was updated successfully, but these errors were encountered: