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 518 forks source link

.NET 9 Application getting stuck with Local nuget package which is migrated to .NET8-iOS and .NET9-iOS from .NET7-iOS #21674

Open ArunaYarra opened 1 day ago

ArunaYarra commented 1 day ago

Apple platform

iOS

Framework version

net8.0-, net9.0-

Affected platform version

.NET 9

Description

Earlier I created the AXAiOSBindings_MAUI nuget package which was compatible with .NET7-ios. That was working as expected in .NET7-ios applications.

Now I migrated that package to .NET8-iOS and .NET9-ios. Please find the csproj here

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net8.0-ios;net9.0-ios</TargetFrameworks>
    <Nullable>enable</Nullable>
    <ImplicitUsings>true</ImplicitUsings>
    <IsBindingProject>true</IsBindingProject>
    <NoBindingEmbedding>false</NoBindingEmbedding>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>

    <PackageId>AXAiOSBindings_MAUI</PackageId>
    <PackageVersion>29.99.99</PackageVersion>
    <Authors>CA Technologies (A Broadcom Company)</Authors>
    <Product>AXAiOSBindings_MAUI</Product>
    <PackageDescription>CAMobileAppAnalytics is an iOS SDK for App Experience Analytics that provides deep insights into the performance, user experience, crash, and log analytics of apps.</PackageDescription>
    <Copyright>Copyright (c) 2013-2023 CA Technologies (A Broadcom Company)</Copyright>
    <PackageProjectUrl>https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/it-operations-management/app-experience-analytics-saas/SaaS/configuring/collect-data-from-ios-applications.html</PackageProjectUrl>
    <PackageTags>AXA APM DXI Broadcom CA App Experience Analytics</PackageTags>
    <PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
    <PackageReadmeFile>README.md</PackageReadmeFile>
  </PropertyGroup>

  <ItemGroup>
    <ObjcBindingApiDefinition Include="ApiDefinition.cs" />
    <ObjcBindingCoreSource Include="StructsAndEnums.cs" />
    <None Include="LICENSE.txt" Pack="true" PackagePath="" />
    <None Include="README.md" Pack="true" PackagePath="\" />
  </ItemGroup>

  <ItemGroup>
    <NativeReference Include="..\SDK\libCAMobileAppAnalytics.a">
      <Kind>Static</Kind>
      <SmartLink>False</SmartLink>
      <ForceLoad>True</ForceLoad>
      <LinkerFlags>-ObjC -lc++ -lz -lsqlite3 -framework CoreLocation -framework SystemConfiguration -framework Foundation -framework UIKit -framework CoreGraphics -framework Security -framework CoreTelephony -framework WebKit -framework WatchConnectivity</LinkerFlags>
    </NativeReference>
    <NativeReference Include="..\SDK\libCAMobileAppAnalytics-simulator.a">
      <Kind>Static</Kind>
      <SmartLink>False</SmartLink>
      <ForceLoad>True</ForceLoad>
      <LinkerFlags>-ObjC -lc++ -lz -lsqlite3 -framework CoreLocation -framework SystemConfiguration -framework Foundation -framework UIKit -framework CoreGraphics -framework Security -framework CoreTelephony -framework WebKit -framework WatchConnectivity</LinkerFlags>
    </NativeReference>
  </ItemGroup>
</Project>

I created the package with .net8 and 9 support, but when I use this package in the .net9 application, the application gets stuck in the AXAiOSBindings_MAUI initialisation part.

Initialised SDK in Platform->iOS->AppDelegate.cs

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
    {
        AXAiOSBindings_MAUI.CAMDOReporter.InitializeSDKWithOptions(AXAiOSBindings_MAUI.SDKOptions.SDKLogLevelVerbose, (_, __) => {
            System.Console.WriteLine("SDK initialized successfully");  
        });
        return base.FinishedLaunching(application, launchOptions);
    }

Here is a sample application: https://github.com/ArunaYarra/AXAiOSBindingsApp.git

Steps to Reproduce

  1. Please download this sample app: https://github.com/ArunaYarra/AXAiOSBindingsApp.git
  2. Add the Local nuget package AXAiOSBindings_MAUI.29.99.99.nupkg, added in this repo
  3. Build and debug the application
  4. The application gets stuck while initialising the AXAiOSBindings_MAUI

The Same package which is compatible with .NET7 working on .NET7 applications, . Here is the package: https://www.nuget.org/packages/AXAiOSBindings_MAUI/24.11.1


Did you find any workaround?

No response

Relevant log output

No response

rolfbjarne commented 21 hours ago

The test project works for me.

Just to narrow this down, a few question:

ArunaYarra commented 10 hours ago

The test project works for me.

Just to narrow this down, a few question:

  • Does it work if you use the .NET 7 NuGet in a .NET 9 project file (withTargetFramework=net9.0)?
  • Does it work if you use the .NET 7 NuGet in a .NET 8 project file (withTargetFramework=net8.0)?

Hi Rolfbjarne,

Thanks for your quick response. No .NET 7 NuGet package not working in .NET 8 and .NET 9 project.

So I migrated AXAiOSBindings_MAUI NuGet to .NET 8 and 9 framework, testing it before releasing officially.

But when you add this .NET 8 and 9 migrated AXAiOSBindings_MAUI NuGet package to any. NET8/9 projects, the application gets stuck after some time.

Expected Result: 2024-11-21 14:41:24.345672+0530 AXAiOSBindingsApp[62001:4629177] [INFO] [CA MAA] CAMAA iOS SDK Build Version = 24.9.1.3 Sep 03 02:07 PM UTC, 2024 2024-11-21 14:41:24.346417+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Registered NSURLConnectionSwizzler swizzler 2024-11-21 14:41:24.346746+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Registered NSURLSessionSwizzler swizzler 2024-11-21 14:41:24.356638+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Registered NSURLSessionConfiguration swizzler 2024-11-21 14:41:24.357056+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] WKWebView is Enabled. 2024-11-21 14:41:24.357244+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Swizzling WKWebView 2024-11-21 14:41:24.357558+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] WKWebview methods are swizzled 2024-11-21 14:41:24.357787+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] UIActivityIndicatorView is Enabled. 2024-11-21 14:41:24.357941+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Swizzling UIActivityIndicatorView 2024-11-21 14:41:24.358084+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] UIApplication is Enabled. 2024-11-21 14:41:24.358259+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Swizzling UIApplication 2024-11-21 14:41:24.358495+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] NSURL Connection is Enabled. 2024-11-21 14:41:24.358614+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Swizzling NSURLConnectionSwizzler 2024-11-21 14:41:24.360916+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] NSURLConnection methods are swizzled 2024-11-21 14:41:24.361086+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] NSURL Session is Enabled. 2024-11-21 14:41:24.361185+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Swizzling NSURLSessionSwizzler 2024-11-21 14:41:24.361797+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] NSURLSession methods are swizzled 2024-11-21 14:41:24.361988+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] NSURL Session Configuration is Enabled. 2024-11-21 14:41:24.362072+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Swizzling NSURLSessionConfiguration 2024-11-21 14:41:24.362759+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] ### CA MAA SDK enabled - 1 2024-11-21 14:41:24.369868+0530 AXAiOSBindingsApp[62001:4629177] [INFO] [CA MAA] Using Aruna_BCBS_camdo.plist 2024-11-21 14:41:24.371077+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] CAMAA Plist file is present 2024-11-21 14:41:24.371197+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] camaa_staticPreferencesDict is NOT nil =6 2024-11-21 14:41:24.371536+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] BackEndURl = https://dxc.dxi-na1.saas.broadcom.com/api/1/urn:ca:tenantId:6D85F3FC-2EF8-4471-8804-BE3B74D6785C/urn:ca:appId:Aruna_BCBS/mobileMetrics 2024-11-21 14:41:24.374727+0530 AXAiOSBindingsApp[62001:4630602] [VERBOSE] [CA MAA] UIViewControllerMethods are swizzled 2024-11-21 14:41:24.835995+0530 AXAiOSBindingsApp[62001:4629177] enabledRemoteNotificationTypes is not supported in iOS 8.0 and later. 2024-11-21 14:41:42.009108+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Download policy - serial operation 2024-11-21 14:41:42.010417+0530 AXAiOSBindingsApp[62001:4630753] [VERBOSE] [CA MAA] Start downloadConfigFileSynchronous 2024-11-21 14:41:42.011005+0530 AXAiOSBindingsApp[62001:4630753] [VERBOSE] [CA MAA] BackEndURl = https://dxc.dxi-na1.saas.broadcom.com/api/1/urn:ca:tenantId:6D85F3FC-2EF8-4471-8804-BE3B74D6785C/urn:ca:appId:Aruna_BCBS/mobileMetrics 2024-11-21 14:41:42.011486+0530 AXAiOSBindingsApp[62001:4630753] [VERBOSE] [CA MAA] Policy URL = https://dxc.dxi-na1.saas.broadcom.com/api/1/urn:ca:tenantId:6D85F3FC-2EF8-4471-8804-BE3B74D6785C/urn:ca:appId:Aruna_BCBS/profile?app_version_id=1.0 2024-11-21 14:41:42.077056+0530 AXAiOSBindingsApp[62001:4630753] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=62001 2024-11-21 14:41:42.077419+0530 AXAiOSBindingsApp[62001:4630753] SecTaskCopyDebugDescription: MAAKitchenSink_M[62001]/0#-1 LF=0 2024-11-21 14:41:42.349693+0530 AXAiOSBindingsApp[62001:4631566] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=62001 2024-11-21 14:41:42.349881+0530 AXAiOSBindingsApp[62001:4631566] SecTaskCopyDebugDescription: MAAKitchenSink_M[62001]/0#-1 LF=0 2024-11-21 14:41:42.350226+0530 AXAiOSBindingsApp[62001:4631566] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=62001 2024-11-21 14:41:42.350336+0530 AXAiOSBindingsApp[62001:4631566] SecTaskCopyDebugDescription: MAAKitchenSink_M[62001]/0#-1 LF=0 2024-11-21 14:41:42.424153+0530 AXAiOSBindingsApp[62001:4629177] [ResourceLoadStatistics] Failed to request storage access user agent string quirks from WebPrivacy. 2024-11-21 14:41:42.425222+0530 AXAiOSBindingsApp[62001:4629177] [ResourceLoadStatistics] Failed to request storage access quirks from WebPrivacy. 2024-11-21 14:41:42.426912+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] BackEndURl = https://dxc.dxi-na1.saas.broadcom.com/api/1/urn:ca:tenantId:6D85F3FC-2EF8-4471-8804-BE3B74D6785C/urn:ca:appId:Aruna_BCBS/mobileMetrics 2024-11-21 14:41:42.427015+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] BackEndURl = https://dxc.dxi-na1.saas.broadcom.com/api/1/urn:ca:tenantId:6D85F3FC-2EF8-4471-8804-BE3B74D6785C/urn:ca:appId:Aruna_BCBS/mobileMetrics 2024-11-21 14:41:42.436601+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] App did become active 2024-11-21 14:41:42.456108+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] CRASH:Adding Custom Data to Crash Reporter for session ID (null) 2024-11-21 14:41:42.466437+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] CRASH:SessionID is empty 2024-11-21 14:41:42.466605+0530 AXAiOSBindingsApp[62001:4629177] [INFO] [CA MAA] New Session Started with Session Id = 726e74b6-7445-4ed1-89d3-a89426d579d0 and session start ts = 1732180302436 2024-11-21 14:41:42.466721+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Attaching CrashReporter... 2024-11-21 14:41:42.466784+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Initializing crash reporter wiht 726e74b6-7445-4ed1-89d3-a89426d579d0 2024-11-21 14:41:42.478231+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] Enabled CrashReporter... 2024-11-21 14:41:42.478333+0530 AXAiOSBindingsApp[62001:4629177] [VERBOSE] [CA MAA] CRASH:Adding Custom Data to Crash Reporter for session ID 726e74b6-7445-4ed1-89d3-a89426d579d0 ............................

Actual result: 2024-11-21 15:31:24.785900+0530 AXAiOSBindingsApp[72457:4818772] [INFO] [CA MAA] CAMAA iOS SDK Build Version = 23.99.0.52 Nov 14 06:34 AM UTC, 2023 2024-11-21 15:31:24.786629+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] Registered NSURLConnectionSwizzler swizzler 2024-11-21 15:31:24.786786+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] Registered NSURLSessionSwizzler swizzler 2024-11-21 15:31:24.786956+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] Registered NSURLSessionConfiguration swizzler 2024-11-21 15:31:24.787126+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] WKWebView is Enabled. 2024-11-21 15:31:24.787371+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] Swizzling WKWebView 2024-11-21 15:31:24.787882+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] WKWebview methods are swizzled 2024-11-21 15:31:24.787988+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] UIActivityIndicatorView is Enabled. 2024-11-21 15:31:24.788101+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] Swizzling UIActivityIndicatorView 2024-11-21 15:31:24.788235+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] UIApplication is Enabled. 2024-11-21 15:31:24.788372+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] Swizzling UIApplication 2024-11-21 15:31:24.788526+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] NSURL Connection is Enabled. 2024-11-21 15:31:24.788596+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] Swizzling NSURLConnectionSwizzler 2024-11-21 15:31:24.789681+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] NSURLConnection methods are swizzled 2024-11-21 15:31:24.789779+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] NSURL Session is Enabled. 2024-11-21 15:31:24.789854+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] Swizzling NSURLSessionSwizzler 2024-11-21 15:31:24.790208+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] NSURLSession methods are swizzled 2024-11-21 15:31:24.790312+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] NSURL Session Configuration is Enabled. 2024-11-21 15:31:24.790372+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] Swizzling NSURLSessionConfiguration 2024-11-21 15:31:24.790781+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] ### CA MAA SDK enabled - 1 2024-11-21 15:31:24.793634+0530 AXAiOSBindingsApp[72457:4818772] [INFO] [CA MAA] Using Aruna_BCBS_camdo.plist 2024-11-21 15:31:24.795773+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] CAMAA Plist file is present 2024-11-21 15:31:24.795851+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] camaa_staticPreferencesDict is NOT nil =6 2024-11-21 15:31:24.796062+0530 AXAiOSBindingsApp[72457:4818772] [VERBOSE] [CA MAA] BackEndURl = https://dxc.dxi-na1.saas.broadcom.com/api/1/urn:ca:tenantId:6D85F3FC-2EF8-4471-8804-BE3B74D6785C/urn:ca:appId:Aruna_BCBS/mobileMetrics 2024-11-21 15:31:24.800067+0530 AXAiOSBindingsApp[72457:4818996] [VERBOSE] [CA MAA] UIViewControllerMethods are swizzled

Please let me know if you need more information to process it further.