xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.48k stars 514 forks source link

How to include multiple frameworks file and use in iOS binding library #21579

Open adarshchiniwar-smartq opened 5 hours ago

adarshchiniwar-smartq commented 5 hours ago

Apple platform

iOS

Framework version

net8.0-*

Affected platform version

Visual Studio Community 2022 for Mac Version 17.6.14 (build 413) Installation UUID: d8226832-e953-4619-a882-8fe01192a9c3 Runtime .NET 7.0.3 (64-bit) Architecture: Arm64 Microsoft.macOS.Sdk 13.1.1007; git-rev-head:8afca776a0a96613dfb7200e0917bb57f9ed5583; git-branch:release/7.0.1xx-xcode14.2 Roslyn (Language Service) 4.6.0-3.23180.6+99e956e42697a6dd886d1e12478ea2b27cceacfa NuGet Version: 6.4.0.117 .NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/8.0.402/Sdks SDK Versions: 8.0.402 8.0.401 8.0.400 7.0.317 6.0.425 MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks .NET SDK (x64) SDK Version: 8.0.401 .NET Runtime (Arm64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 9.0.0-rc.1.24431.7 8.0.8 7.0.20 6.0.33 .NET Runtime (x64) Runtime: /usr/local/share/dotnet/x64/dotnet Runtime Version: 8.0.8 Xamarin.Profiler Version: 1.8.0.49 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler Updater Version: 11 Apple Developer Tools Xcode: 16.0 23051 Build: 16A242d Xamarin.Mac Not Installed Xamarin.iOS Version: 16.4.0.23 Visual Studio Community Hash: 9defd91b3 Branch: xcode14.3 Build date: 2023-10-23 16:15:00-0400 Xamarin.Android Version: 13.2.2.0 (Visual Studio Community) Commit: xamarin-android/d17-5/45b0e14 Android SDK: /Users/adarshchiniwar/Library/Android/sdk Supported Android versions: None installed SDK Command-line Tools Version: 7.0 SDK Platform Tools Version: 35.0.2 SDK Build Tools Version: 35.0.0 Build Information: Mono: d9a6e87 Java.Interop: xamarin/java.interop/d17-5@149d70fe SQLite: xamarin/sqlite/3.40.1@68c69d8 Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d Microsoft Build of OpenJDK Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk 11.0.16.1 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL Eclipse Temurin JDK Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk 1.8.0.302 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL Android SDK Manager Version: 17.6.0.50 Hash: a715dca Branch: HEAD Build date: 2024-08-07 17:47:27 UTC Android Device Manager Version: 0.0.0.1309 Hash: 06e3e77 Branch: HEAD Build date: 2024-08-07 17:47:27 UTC Xamarin Designer Version: 17.6.3.9 Hash: 2648399ae8 Branch: remotes/origin/d17-6 Build date: 2024-08-07 17:47:20 UTC Build Information Release ID: 1706140413 Git revision: 29d5da805da9895dd02785823633e3bcfabdd769 Build date: 2024-08-07 17:45:52+00 Build branch: release-17.6 Build lane: release-17.6 Operating System Mac OS X 14.5.0 Darwin 23.5.0 Darwin Kernel Version 23.5.0 Wed May 1 20:19:05 PDT 2024 root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64

Description

Hi,

We have got 10 xcframework files that requires for an integration a payment device. I know that we need to create a ApiDefinitions and structsAndEnums.cs using Sharpie, How can i include ApidDefinitions and structsAndEnums.cs for each framework file in iOS Binding library and use it in .net maui project.

Thanks, Adarsh

Steps to Reproduce

Please help me with the sample project if you have. Below is .csproj file of iOS binding library.

<ItemGroup>
        <NativeReference Include="FPAmaKit.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
        <NativeReference Include="FPLoggerKit.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
        <NativeReference Include="FPPOICore.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
        <NativeReference Include="FPRuaKit.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
        <NativeReference Include="FPTetraKit.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
        <NativeReference Include="iFCCCore.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
        <NativeReference Include="iFCCKit.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
        <NativeReference Include="iSAF.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
        <NativeReference Include="RUA_MFI.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
        <NativeReference Include="TemLibrary.xcframework">
            <Kind>Framework</Kind>
            <SmartLink>False</SmartLink>
            <ForceLoad>True</ForceLoad>
        </NativeReference>
    </ItemGroup>

Did you find any workaround?

No response

Build logs

No response

rolfbjarne commented 5 hours ago

Can you try something like this in the project file?

<ItemGroup>
    <ObjcBindingApiDefinition Include="ApiDefinition1.cs" />
    <ObjcBindingApiDefinition Include="ApiDefinition2.cs" />
    <ObjcBindingApiDefinition Include="ApiDefinition3.cs" />

    <ObjcBindingCoreSource Include="StructsAndEnums1.cs" />
    <ObjcBindingCoreSource Include="StructsAndEnums2.cs" />
    <ObjcBindingCoreSource Include="StructsAndEnums3.cs" />
</ItemGroup>
microsoft-github-policy-service[bot] commented 5 hours ago

Hi @adarshchiniwar-smartq. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.