GoogleApisForiOSComponents icon indicating copy to clipboard operation
GoogleApisForiOSComponents copied to clipboard

iOS is crashing on deploy. It was working fine a few days ago, and no changes have been made to the project.

Open racoltacalin opened this issue 10 months ago • 29 comments

clang++ exited with code 1:
Undefined symbols for architecture arm64:
  "_GULOSLogBasic", referenced from:
      _MLKLog in MLKitCommon[arm64][7](MLKLogger.o)
  "_GULOSLogError", referenced from:
      -[GULCCComponentContainer populateComponentsFromRegisteredClasses:withContext:] in MLKitCommon[arm64][212](GULCCComponentContainer.o)
      -[GULCCComponentContainer instantiateInstanceForProtocol:withBlock:] in MLKitCommon[arm64][212](GULCCComponentContainer.o)
  "_OBJC_CLASS_$_GULUserDefaults", referenced from:
       in MLKitCommon[arm64][2](MLKAnalyticsLogger.o)
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)


racoltacalin avatar Mar 05 '25 20:03 racoltacalin

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net8.0;net8.0-android;net8.0-ios;</TargetFrameworks>
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>

    <OutputType Condition="'$(TargetFramework)' != 'net8.0'">Exe</OutputType>
    <MauiVersion>8.0.40</MauiVersion>
    <UseMaui>true</UseMaui>
    <SingleProject>true</SingleProject>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>

    <!-- Versions -->
    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
    <ApplicationVersion>1</ApplicationVersion>

    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">13.0</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
    <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
  </PropertyGroup>

  <PropertyGroup Condition="( '$(TargetFramework)' == 'net8.0-ios' )">
    <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
    <PlatformTarget>arm64</PlatformTarget>
    <ProvisioningType>manual</ProvisioningType>
    <MtouchExtraArgs>-ObjC</MtouchExtraArgs>
  </PropertyGroup>

  <PropertyGroup>
    <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  </PropertyGroup>

  <ItemGroup>
    <!-- App Icon -->
    <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

    <!-- Splash Screen -->
    <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

    <!-- Images -->
    <MauiImage Include="Resources\Images\*" />
    <MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />

    <!-- Custom Fonts -->
    <MauiFont Include="Resources\Fonts\*" />

    <!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
    <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
  </ItemGroup>

  <ItemGroup>
    <!--<PackageReference Include="BarcodeScanner.Mobile.Maui" />-->
    <PackageReference Include="Microsoft.Maui.Controls" />
    <PackageReference Include="Microsoft.Maui.Controls.Compatibility" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" />
    <PackageReference Include="Xamarin.AndroidX.Activity" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />
    <PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />
    <PackageReference Include="Plugin.Maui.Audio" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\BarcodeScanner.Mobile.Maui\BarcodeScanner.Mobile.Maui.csproj" />
  </ItemGroup>


</Project>

racoltacalin avatar Mar 05 '25 20:03 racoltacalin

 <!-- Mobile App -->
 <PackageVersion Include="BarcodeScanner.Mobile.Maui" Version="8.0.40.1" />
 <PackageVersion Include="Microsoft.Maui.Controls" Version="8.0.40" />
 <PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
 <PackageVersion Include="Xamarin.AndroidX.Activity" Version="1.9.0.2" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />
 <PackageVersion Include="Xamarin.AndroidX.Activity.Ktx" Version="1.9.0.2" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />
 <PackageVersion Include="Plugin.Maui.Audio" Version="3.0.1" />
 <PackageVersion Include="coverlet.collector" Version="6.0.0" />
 <PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
 <PackageVersion Include="NUnit" Version="3.14.0" />
 <PackageVersion Include="NUnit.Analyzers" Version="3.9.0" />
 <PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
 <PackageVersion Include="Xamarin.AndroidX.Collection" Version="1.4.0.4"/>
 <PackageVersion Include="Xamarin.AndroidX.Collection.Jvm" Version="1.4.0.3"/>
 <PackageVersion Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.3"/>
 <PackageVersion Include="Xamarin.AndroidX.Camera.Camera2" Version="1.3.3.2"/>
 <PackageVersion Include="Xamarin.AndroidX.Camera.Lifecycle" Version="1.3.3.2"/>
 <PackageVersion Include="Xamarin.AndroidX.Camera.View" Version="1.3.3.2"/>
 <PackageVersion Include="Xamarin.Google.MLKit.Common" Version="118.10.0.2"/>
 <PackageVersion Include="Xamarin.Google.MLKit.Vision.Common" Version="117.3.0.8"/>
 <PackageVersion Include="Xamarin.Google.MLKit.BarcodeScanning" Version="117.2.0.4"/>
 <PackageVersion Include="Xamarin.GooglePlayServices.MLKit.Text.Recognition" Version="119.0.0.6"/>			
 <PackageVersion Include="AdamE.MLKit.iOS.BarcodeScanning" Version="6.0.0" />
 <PackageVersion Include="Xamarin.Build.Download" Version="0.11.4" />

racoltacalin avatar Mar 05 '25 20:03 racoltacalin

I tried this but I'm still getting the same error. I tried using Mac machine (Air-M2 - Squoia 15.3.1) and also from windows.

racoltacalin avatar Mar 05 '25 20:03 racoltacalin

I also tried this:

<Target Name="LinkWithSwift" DependsOnTargets="_ParseBundlerArguments;_DetectSdkLocations" BeforeTargets="_LinkNativeExecutable">
		<PropertyGroup>
			<_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('iossimulator-'))">iphonesimulator</_SwiftPlatform>
			<_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('ios-'))">iphoneos</_SwiftPlatform>
		</PropertyGroup>
		<ItemGroup>
			<_CustomLinkFlags Include="-L" />
			<_CustomLinkFlags Include="/usr/lib/swift" />
			<_CustomLinkFlags Include="-L" />
			<_CustomLinkFlags Include="$(_SdkDevPath)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(_SwiftPlatform)" />
			<_CustomLinkFlags Include="-Wl,-rpath" />
			<_CustomLinkFlags Include="-Wl,/usr/lib/swift" />
		</ItemGroup>
	</Target>

One week ago, I'm not sure exactly what I fixed—I had a similar issue and tried all the solutions from various repositories. I'm using this library: BarcodeScanner.Mobile. Based on comments in the issues, I navigated through different repositories and discussions, and I was able to build and deploy the iOS version. But now, a couple of days later, without modifying the csproj or code, I'm encountering this strange issue.

racoltacalin avatar Mar 05 '25 20:03 racoltacalin

I was also using the library locally and had these packages referenced directly, even though I believe they are only transitive packages:

<ItemGroup>
		<PackageReference Include="AdamE.Firebase.iOS.Core" Version="11.6.0" />
		<!--<PackageReference Include="BarcodeScanner.Mobile.Maui" Version="8.0.40.1" />-->
		<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.40" />
		<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
		<PackageReference Include="Plugin.Maui.Audio" Version="3.0.1" />
	</ItemGroup>

	<ItemGroup>
	  <ProjectReference Include="..\BarcodeScanner.Mobile.Maui\BarcodeScanner.Mobile.Maui.csproj" />
	</ItemGroup>

But afterwards, I removed the library from the solution and used the NuGet packages, and it worked (I think the cache was in place), but now something seems to have been compromised.

racoltacalin avatar Mar 05 '25 20:03 racoltacalin

What is in your MLKCommon-12.0.0 directory in your XBD cache?

AdamEssenmacher avatar Mar 05 '25 21:03 AdamEssenmacher

Image

racoltacalin avatar Mar 05 '25 21:03 racoltacalin

Are you actually using AdamE.Firebase.iOS.Core? If not, try removing it and see what happens.

And then try adding AdamE.Google.iOS.GoogleUtilities.

AdamEssenmacher avatar Mar 05 '25 21:03 AdamEssenmacher

I think I added AdamE.Firebase.iOS.Core to fix some of the issues mentioned in the BarcodeScanner.Mobile.Maui library. :)

racoltacalin avatar Mar 05 '25 21:03 racoltacalin

Hmm, but I don't have a reference to AdamE.Firebase.iOS.Core in my project.

racoltacalin avatar Mar 05 '25 21:03 racoltacalin

transitive-packages.txt

   > AdamE.Google.iOS.GoogleDataTransport                       10.1.0   
   > AdamE.Google.iOS.GTMSessionFetcher                         3.5.0    
   > AdamE.Google.iOS.Nanopb                                    3.30910.0
   > AdamE.Google.iOS.PromisesObjC                              2.4.0    
   > AdamE.MLKit.iOS.BarcodeScanning                            6.0.0    
   > AdamE.MLKit.iOS.Core                                       12.0.0   

racoltacalin avatar Mar 05 '25 21:03 racoltacalin

Hmm, but I don't have a reference to AdamE.Firebase.iOS.Core in my project.

I see it in:

	<PackageReference Include="AdamE.Firebase.iOS.Core" Version="11.6.0" />
	<!--<PackageReference Include="BarcodeScanner.Mobile.Maui" Version="8.0.40.1" />-->
	<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.40" />
	<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
	<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
	<PackageReference Include="Plugin.Maui.Audio" Version="3.0.1" />
</ItemGroup>

<ItemGroup>
  <ProjectReference Include="..\BarcodeScanner.Mobile.Maui\BarcodeScanner.Mobile.Maui.csproj" />
</ItemGroup>

AdamEssenmacher avatar Mar 05 '25 21:03 AdamEssenmacher

Yes, but as I mentioned, that was before when I referenced the BarcodeScanner.Mobile.Maui.csproj locally rather than as a package.

racoltacalin avatar Mar 05 '25 21:03 racoltacalin

Now, my csproj looks like this:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net8.0;net8.0-android;net8.0-ios;</TargetFrameworks>
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>

    <OutputType Condition="'$(TargetFramework)' != 'net8.0'">Exe</OutputType>
    <RootNamespace>X</RootNamespace>
    <MauiVersion>8.0.40</MauiVersion>
    <UseMaui>true</UseMaui>
    <SingleProject>true</SingleProject>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>

    <!-- Display name -->
    <ApplicationTitle>X</ApplicationTitle>

    <!-- App Identifier -->
    <ApplicationId>Y</ApplicationId>

    <!-- Versions -->
    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
    <ApplicationVersion>1</ApplicationVersion>

    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">13.0</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
    <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
  </PropertyGroup>

  <PropertyGroup Condition="( '$(TargetFramework)' == 'net8.0-ios' )">
    <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
    <PlatformTarget>arm64</PlatformTarget>
    <ProvisioningType>manual</ProvisioningType>
  </PropertyGroup>

  <PropertyGroup>
    <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  </PropertyGroup>

  <ItemGroup>
    <!-- App Icon -->
    <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

    <!-- Splash Screen -->
    <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

    <!-- Images -->
    <MauiImage Include="Resources\Images\*" />
    <MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />

    <!-- Custom Fonts -->
    <MauiFont Include="Resources\Fonts\*" />

    <!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
    <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="BarcodeScanner.Mobile.Maui"/>
    <PackageReference Include="Microsoft.Maui.Controls"/>
    <PackageReference Include="Microsoft.Maui.Controls.Compatibility"/>
    <PackageReference Include="Microsoft.Extensions.Logging.Debug"/>
    <PackageReference Include="Xamarin.AndroidX.Activity" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />
    <PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />
    <PackageReference Include="Plugin.Maui.Audio"/>
  </ItemGroup>
</Project>

racoltacalin avatar Mar 05 '25 21:03 racoltacalin

OK try adding that reference to AdamE.Google.iOS.GoogleUtilities

AdamEssenmacher avatar Mar 05 '25 22:03 AdamEssenmacher

Adding this reference fixed my issue. Can you tell me why? :)

racoltacalin avatar Mar 05 '25 22:03 racoltacalin

The missing symbol GULOSLogBasic is from GoogleUtilities.

In the past, GoogleUtilities was included as part of *.Firebase.iOS.Core, so including it would also include GoogleUtilities. This situation was not ideal for a few reasons. MLKit shouldn't require a dependency on Firebase. I've done some work to separate these out so that the Firebase packages are not required, but still compatible.

Unfortunately, it looks like I missed adding the GoogleUtilities reference to MLKit. It's a bug.

AdamEssenmacher avatar Mar 05 '25 22:03 AdamEssenmacher

For some reason adding a reference to AdamE.Google.iOS.GoogleUtilities (latest) didn't fix the issue in my project. Althought compared to racoltacalin we are on net9 ios 18.2 so that might have some impact

Lee31416 avatar Mar 13 '25 17:03 Lee31416

For some reason adding a reference to AdamE.Google.iOS.GoogleUtilities (latest) didn't fix the issue in my project. Althought compared to racoltacalin we are on net8ios 18.1 or\and 18.2 so that might have some impact

kochev avatar Mar 14 '25 08:03 kochev

update AdamE.MLKit.iOS.BarcodeScanning to 6.0.0 fixes build for me

kochev avatar Mar 14 '25 11:03 kochev

Looks like I am hitting another error after adding AdamE.Google.iOS.GoogleUtilities Running with MAUI 9.0.50, .NET 9

  EXEC : error HE1046: Additional output: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x301da39c0'
    EXEC : error HE1046: Additional output: *** First throw call stack:
    EXEC : error HE1046: Additional output: (0x1866f25fc 0x183c6d244 0x18684b174 0x1866f55c8 0x1866f4ef0 0x100ba832c 0x100ba57c8 0x100ba56dc 0x100ba47ec 0x100ba4158 0x18e481248 0x18e482fa8 0x18e48a5cc 0x18e48b158 0x18e49638c 0x18e495bd8 0x211408680 0x211406474)
    EXEC : error HE1046: Additional output: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x301da39c0'
    EXEC : error HE1046: Additional output: *** First throw call stack:
    EXEC : error HE1046: Additional output: (0x1866f25fc 0x183c6d244 0x18684b174 0x1866f55c8 0x1866f4ef0 0x100ba832c 0x100ba57c8 0x100ba56dc 0x100ba47ec 0x100ba4158 0x18e481248 0x18e482fa8 0x18e48a5cc 0x18e48b158 0x18e49638c 0x18e495bd8 0x211408680 0x211406474)
    EXEC : error HE1046: Additional output:
    EXEC : error HE1046: Additional output: =================================================================
    EXEC : error HE1046: Additional output: 2025-03-14 23:45:48.653 SampleApp.Maui[43474:9025671] Detected recursion when handling uncaught Objective-C exception: -[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x301da39c0

JimmyPun610 avatar Mar 14 '25 12:03 JimmyPun610

Looks like I am hitting another error after adding AdamE.Google.iOS.GoogleUtilities Running with MAUI 9.0.50, .NET 9

  EXEC : error HE1046: Additional output: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x301da39c0'
    EXEC : error HE1046: Additional output: *** First throw call stack:
    EXEC : error HE1046: Additional output: (0x1866f25fc 0x183c6d244 0x18684b174 0x1866f55c8 0x1866f4ef0 0x100ba832c 0x100ba57c8 0x100ba56dc 0x100ba47ec 0x100ba4158 0x18e481248 0x18e482fa8 0x18e48a5cc 0x18e48b158 0x18e49638c 0x18e495bd8 0x211408680 0x211406474)
    EXEC : error HE1046: Additional output: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x301da39c0'
    EXEC : error HE1046: Additional output: *** First throw call stack:
    EXEC : error HE1046: Additional output: (0x1866f25fc 0x183c6d244 0x18684b174 0x1866f55c8 0x1866f4ef0 0x100ba832c 0x100ba57c8 0x100ba56dc 0x100ba47ec 0x100ba4158 0x18e481248 0x18e482fa8 0x18e48a5cc 0x18e48b158 0x18e49638c 0x18e495bd8 0x211408680 0x211406474)
    EXEC : error HE1046: Additional output:
    EXEC : error HE1046: Additional output: =================================================================
    EXEC : error HE1046: Additional output: 2025-03-14 23:45:48.653 SampleApp.Maui[43474:9025671] Detected recursion when handling uncaught Objective-C exception: -[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x301da39c0

Getting the same error, it has something to do with the new iOS SDK e.g., it looks like it works on 18.2, but fails in newer versions

stepkillah avatar Apr 17 '25 10:04 stepkillah

Looks like I am hitting another error after adding AdamE.Google.iOS.GoogleUtilities Running with MAUI 9.0.50, .NET 9

  EXEC : error HE1046: Additional output: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x301da39c0'
    EXEC : error HE1046: Additional output: *** First throw call stack:
    EXEC : error HE1046: Additional output: (0x1866f25fc 0x183c6d244 0x18684b174 0x1866f55c8 0x1866f4ef0 0x100ba832c 0x100ba57c8 0x100ba56dc 0x100ba47ec 0x100ba4158 0x18e481248 0x18e482fa8 0x18e48a5cc 0x18e48b158 0x18e49638c 0x18e495bd8 0x211408680 0x211406474)
    EXEC : error HE1046: Additional output: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x301da39c0'
    EXEC : error HE1046: Additional output: *** First throw call stack:
    EXEC : error HE1046: Additional output: (0x1866f25fc 0x183c6d244 0x18684b174 0x1866f55c8 0x1866f4ef0 0x100ba832c 0x100ba57c8 0x100ba56dc 0x100ba47ec 0x100ba4158 0x18e481248 0x18e482fa8 0x18e48a5cc 0x18e48b158 0x18e49638c 0x18e495bd8 0x211408680 0x211406474)
    EXEC : error HE1046: Additional output:
    EXEC : error HE1046: Additional output: =================================================================
    EXEC : error HE1046: Additional output: 2025-03-14 23:45:48.653 SampleApp.Maui[43474:9025671] Detected recursion when handling uncaught Objective-C exception: -[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x301da39c0

@AdamEssenmacher it seems that by including AdamE.Firebase.iOS.Installations (>= 11.0.0) (in addition to AdamE.Google.iOS.GoogleUtilities), all issues are fixed even with iOS SDK 18.4 . Could we expect a new release of your bindings in the near future?

inimirpaz avatar Jul 10 '25 14:07 inimirpaz

@AdamEssenmacher Is there a way to fix the NSInvalidArgumentException? I am on iOS workload 18.5.9219 and have the following references:

<PackageReference Include="BarcodeScanner.Mobile.Maui" Version="9.0.1" />
<PackageReference Include="AdamE.Firebase.iOS.Core" Version="12.0.0" />
<PackageReference Include="AdamE.MLKit.iOS.BarcodeScanning" Version="6.0.0.2" />

FlavioGoncalves-Cayas avatar Sep 18 '25 14:09 FlavioGoncalves-Cayas

@FlavioGoncalves-Cayas don't include Firebase.iOS.Core unless you actually need Firebase.

Add the reference to GoogleUtilities.

AdamEssenmacher avatar Sep 18 '25 16:09 AdamEssenmacher

@AdamEssenmacher I need Firebase. Sorry forgot to include it in my comment. I am referencing <PackageReference Include="Plugin.Firebase.CloudMessaging" Version="3.1.2" />

Also added <PackageReference Include="AdamE.Google.iOS.GoogleUtilities" Version="8.1.0" />

But the app still terminates with

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x128d53640'
*** First throw call stack:
(0x19ba112ec 0x198e95a7c 0x19ba7b67c 0x19b928b84 0x19b9284f0 0x1048d3490 0x1048d092c 0x1048d0840 0x1048cf950 0x1048cf2bc 0x1a3875aac 0x1a388f584 0x1a387e2d0 0x1a387ede0 0x1a38891dc 0x1a3888a60 0x225e61660 0x225e5e9f8)

FlavioGoncalves-Cayas avatar Sep 19 '25 09:09 FlavioGoncalves-Cayas

@AdamEssenmacher I need Firebase. Sorry forgot to include it in my comment. I am referencing <PackageReference Include="Plugin.Firebase.CloudMessaging" Version="3.1.2" />

Also added <PackageReference Include="AdamE.Google.iOS.GoogleUtilities" Version="8.1.0" />

But the app still terminates with

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTLogContext hashForFilePath]: unrecognized selector sent to instance 0x128d53640'
*** First throw call stack:
(0x19ba112ec 0x198e95a7c 0x19ba7b67c 0x19b928b84 0x19b9284f0 0x1048d3490 0x1048d092c 0x1048d0840 0x1048cf950 0x1048cf2bc 0x1a3875aac 0x1a388f584 0x1a387e2d0 0x1a387ede0 0x1a38891dc 0x1a3888a60 0x225e61660 0x225e5e9f8)

Have you tried doing like I wrote: https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/issues/79#issuecomment-3057680081 ?

inimirpaz avatar Sep 19 '25 09:09 inimirpaz

@inimirpaz you mean include AdamE.Firebase.iOS.Installations (>= 11.0.0)? Does not change anything for me. I added <PackageReference Include="AdamE.Firebase.iOS.Installations" Version="12.0.0" />

Still the same error

FlavioGoncalves-Cayas avatar Sep 19 '25 09:09 FlavioGoncalves-Cayas

Made the switch over to https://github.com/afriscic/BarcodeScanning.Native.Maui which works fine for me

FlavioGoncalves-Cayas avatar Sep 19 '25 11:09 FlavioGoncalves-Cayas