AdamEssenmacher / GoogleApisForiOSComponents

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

.NET 8 iOS app build with AdamE.MLKit.iOS.BarcodeScanning.JimmyPun610 fails with 'clang++ exited with code 1' error #34

Open ydamanau opened 3 months ago

ydamanau commented 3 months ago

Hi Adam,

I'm trying to substitute Xamarin.MLKit.iOS.BarcodeScanning.JimmyPun610 with your AdamE.MLKit.iOS.BarcodeScanning.JimmyPun610. Unfortunately, our app build fails with the following error:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.5/17.5.8018/targets/Xamarin.Shared.Sdk.targets(3,3): Error: clang++ exited with code 1:
Undefined symbols for architecture x86_64:
  "_MLKModelDownloadDidFailNotification", referenced from:
     -exported_symbol[s_list] command line option
  "_MLKModelDownloadDidSucceedNotification", referenced from:
     -exported_symbol[s_list] command line option
  "_MLKModelDownloadUserInfoKeyError", referenced from:
     -exported_symbol[s_list] command line option
  "_MLKModelDownloadUserInfoKeyRemoteModel", referenced from:
     -exported_symbol[s_list] command line option
  "_OBJC_CLASS_$_GMLImage", referenced from:
     -exported_symbol[s_list] command line option
  "_OBJC_CLASS_$_MLKBarcode", referenced from:
     -exported_symbol[s_list] command line option
  "_OBJC_CLASS_$_MLKBarcodeAddress", referenced from:
     -exported_symbol[s_list] command line option
  "_OBJC_CLASS_$_MLKBarcodeCalendarEvent", referenced from:
     -exported_symbol[s_list] command line option
  "_OBJC_CLASS_$_MLKBarcodeContactInfo", referenced from:
     -exported_symbol[s_list] command line option
  "_OBJC_CLASS_$_MLKBarcodeDriverLicense", referenced from:
     -exported_symbol[s_list] command line option
  "_OBJC_CLASS_$_MLKBarcodeEmail", referenced from:
     -exported_symbol[s_list] command line option
  "_OBJC_CLASS_$_MLKBarcodeGeoPoint", referenced from:
     -exported_symbol[s_list] command line option

I attempted to resolve it using the LinkWithSwift target and explicitly added dependencies, but that didn't help. I also believe it's not a long-path issue because I'm building on macOS.

This issue doesn't seem to be related to incompatibility either. I created a clean net8.0-ios project, added BarcodeScanning, and it failed with the same error. I’ve uploaded this project to the following repo: https://github.com/ydamanau/IosTestApp/tree/main.

I'm using Visual Studio Community 2022 for Mac 17.6.13 (build 424), .NET SDK 8.0.303 (Arm64), .NET Runtime 8.0.7 (Arm64), and Xcode 15.4.

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
maui-ios                   8.0.72/8.0.100         SDK 8.0.300        
maui-android               8.0.72/8.0.100         SDK 8.0.300        
ios                        17.5.8018/8.0.100      SDK 8.0.300        
maui-mobile                8.0.72/8.0.100         SDK 8.0.300        
maui                       8.0.72/8.0.100         SDK 8.0.300        
android                    34.0.113/8.0.100       SDK 8.0.300  

Is there any chance you could look into this and help us resolve the issue? Thank you!

jerry2007 commented 3 weeks ago

.NET 9 crash also...