AdamEssenmacher / GoogleApisForiOSComponents

A community-supported fork of the abandoned Xamarin.iOS.* binding libraries from Microsoft
MIT License
40 stars 7 forks source link

Error: clang++ exited with code 1: #23

Closed IrynaDoroshenkoDev closed 2 weeks ago

IrynaDoroshenkoDev commented 4 weeks ago

Hi! Today I updated my Firebase plugings for the MAUI .NET8 to version 3.0.0. 2.0.4) includes Adam's packages in the new version. also, i tried to add ONLy Adam's packages for iOS with the same result. So i assume i did something wrong or have some wrong settings/enviroment

"Plugin.Firebase.Crashlytics" Version="3.0.0" "Plugin.Firebase.CloudMessaging" Version="3.0.0"

Before were and without Adam's packages:

"Plugin.Firebase.Crashlytics" Version="2.0.3" "Plugin.Firebase.CloudMessaging" Version="2.0.4"

I am facing such an error. both real devices and simulators. (bin/obj were cleaned, and the app re-builded)

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(3,3): Error: clang++ exited with code 1: Undefined symbols for architecture arm64: "_GPBClearOneof", referenced from: _MOBTransform_ClearTransformOneOfCase in MLKitMDD "_OBJCCLASS$_GPBAny", referenced from: _descriptor.fields.72 in MLKitMDD _descriptor.fields.23 in MLKitMDD _descriptor.fields.87 in MLKitMDD _descriptor.fields.158 in MLKitMDD "_OBJCCLASS$_GPBCodedOutputStream", referenced from: objc-class-ref in MLKitCommon(CCTLogOutputStream.o) "_OBJCCLASS$_GPBDescriptor", referenced from: objc-class-ref in MLKitMDD objc-class-ref in MLKitCommon(FirebaseMlSdk.pbobjc.o) objc-class-ref in MLKitCommon(VisionExtension.pbobjc.o) objc-class-ref in MLKitCommon(Barhopper.pbobjc.o) objc-class-ref in MLKitCommon(Clientanalytics.pbobjc.o) objc-class-ref in MLKitCommon(LogContext.pbobjc.o) objc-class-ref in MLKitCommon(UploaderState.pbobjc.o) ... "_OBJCCLASS$_GPBEnumArray", referenced from: objc-class-ref in MLKitBarcodeScanning "_OBJCCLASS$_GPBEnumDe (Zoeller.ZControl.Mobile.MAUI)

Visual studio for MAC 17.6.12 (build 410) XCode Version 15.3 (15E204a)

Here my .csproj

---------- 23.0 34.0 11.0 17.2 Debug;Release;Test en-US $(PackageId) True 1701;1702;CA1416; True True True <_ExportSymbolsExplicitly>False True True SdkOnly true false $(PackageId) 1701;1702;CA1416; True True r8 True True False True <_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('iossimulator-'))">iphonesimulator <_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('ios-'))">iphoneos <_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" /> Screenshot 2024-05-30 at 13 01 03
bengavin commented 4 weeks ago

Try switching BarcodeScanner.Mobile.Maui to version 8.0.0.1, we're running into the same compile issue when referencing that component.

IrynaDoroshenkoDev commented 4 weeks ago

Try switching BarcodeScanner.Mobile.Maui to version 8.0.0.1, we're running into the same compile issue when referencing that component.

Thank you! I tried the downgrade BarcodeScanner.Mobile.Maui to version 8.0.0.1, cleaned bin/obj , restated VS and the project. several times with no luck

IrynaDoroshenkoDev commented 4 weeks ago

this issue is related to BarcodeScanner.Mobile.Maui ANY version, I can not use them together. With/without other Barcode scanner nuggets - it works fine

bengavin commented 4 weeks ago

this issue is related to BarcodeScanner.Mobile.Maui ANY version, I can not use them together. With/without other Barcode scanner nuggets - it works fine

This is likely because that BarcodeScanner library uses the MLKit components, but referenced from another custom library. I'm actually actively in the process of trying to get the MLKit BarcodeScanning library here enabled so I can fork that project and point it over here, rather than its own custom thing.

It's been ... challenging to be honest, can't get the stuff to build locally on my Mac due to some missing sub-components or whatnot. Removing Xamarin support and switching over to .NET 8 seems to help, but I'm still only a couple hours into the investigation.

IrynaDoroshenkoDev commented 4 weeks ago

this issue is related to BarcodeScanner.Mobile.Maui ANY version, I can not use them together. With/without other Barcode scanner nuggets - it works fine

This is likely because that BarcodeScanner library uses the MLKit components, but referenced from another custom library. I'm actually actively in the process of trying to get the MLKit BarcodeScanning library here enabled so I can fork that project and point it over here, rather than its own custom thing.

It's been ... challenging to be honest, can't get the stuff to build locally on my Mac due to some missing sub-components or whatnot. Removing Xamarin support and switching over to .NET 8 seems to help, but I'm still only a couple hours into the investigation.

yeah, this library BarcodeScanner.Mobile.Mau pretty fast and works perfectly for me! this one ZXing.Net.Maui much more slower

IrynaDoroshenkoDev commented 3 weeks ago

This is likely because that BarcodeScanner library uses the MLKit components, but referenced from another custom library. I'm actually actively in the process of trying to get the MLKit BarcodeScanning library here enabled so I can fork that project and point it over here, rather than its own custom thing.

It's been ... challenging to be honest, can't get the stuff to build locally on my Mac due to some missing sub-components or whatnot. Removing Xamarin support and switching over to .NET 8 seems to help, but I'm still only a couple hours into the investigation.

Hi! Have you resolved this issue? Or did you just take another scanner lib?

AdamEssenmacher commented 3 weeks ago

The native Firebase and MLKit SDK libraries have some shared native dependencies:

This means that Nuget packages shipping MLKit or Firebase bindings either need to 1) include .xcframeworks for each of these libraries or 2) reference a package that includes these xcframeworks.

The problem with approach (1) is that if there is an intersection between the .xcframeworks included in two Nugets, then the packages will be incompatible with each other.

The problem with approach (2) is that there is no longer a central authority that should be trusted to publish and maintain these common dependencies. Historically this was handled by Xamarin, but that is no longer the case.

I don't know how that scanner library gets these shared dependencies, but unless both projects agree on the source, then they'll likely stay incompatible with each other.

bengavin commented 2 weeks ago

@IrynaDoroshenkoDev - the latest 8.0.40.1 version of BarcodeScanner.Mobile.Maui should be working with the support of the libraries here.

IrynaDoroshenkoDev commented 2 weeks ago

@IrynaDoroshenkoDev - the latest 8.0.40.1 version of BarcodeScanner.Mobile.Maui should be working with the support of the libraries here.

Thank you so much!