AdamEssenmacher / GoogleApisForiOSComponents

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

Analytics: Undefined symbols for architecture arm64 #29

Closed coop-tim closed 4 months ago

coop-tim commented 5 months ago

Firstly, thank you for your hard work updating these bindings. I've tried to update to them but can't get the AdamE.Firebase.iOS.Analytics package to build for iOS.

Environment Windows 11 Visual Studio Enterprise 17.11.0 Preview 1.1 paired to Mac 14.5 XCode 15.3 Targeting iOS 17.4 .NET 8

Error

Error (active)      clang++ exited with code 1:
Undefined symbols for architecture arm64:
  "_APMUserDataFieldHashedEmailAddress", referenced from:
      +[FIRAnalytics initiateOnDeviceConversionMeasurementWithHashedEmailAddress:] in FirebaseAnalytics(FIRAnalytics.o)
  "_APMUserDataFieldHashedPhoneNumber", referenced from:
      +[FIRAnalytics initiateOnDeviceConversionMeasurementWithHashedPhoneNumber:] in FirebaseAnalytics(FIRAnalytics.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation) MauiSample (net8.0-ios) C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets    1560        

I also get warnings

The framework C:/Users/coop-tim/AppData/Local/XamarinBuildDownloadCache/FAnlytcs-10.24.0/FirebaseAnalytics-10.24.0/Frameworks/FirebaseAnalytics.xcframework/ios-arm64/FirebaseAnalytics.framework is a framework of static libraries, and will not be copied to the app.

The framework C:/Users/coop-tim/AppData/Local/XamarinBuildDownloadCache/GAppM-10.24.0/GoogleAppMeasurement-10.24.0/Frameworks/GoogleAppMeasurement.xcframework/ios-arm64/GoogleAppMeasurement.framework is a framework of static libraries, and will not be copied to the app

Repro https://github.com/coop-tim/maui-sample/tree/feature/adame

I've tried the usual clearing of XamarinBuildDownloadCache, bin/obj, Xamarin folders etc as well as a dotnet restore.

Any advice appreciated

AdamEssenmacher commented 5 months ago

The project is building for me just fine on Mac. Since you're on Windows, my first thought would be to check the long file path issue: https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/issues/13

AdamEssenmacher commented 5 months ago

Did that help @coop-tim ?

coop-patrick commented 4 months ago

Hi @AdamEssenmacher - @coop-tim should be able to respond next week but from my understanding we're aware of the long filenames issue and have worked around that. I'm able to build on my windows machine but I can see the issue presented itself on azure pipelines as I can see our most recent pipeline builds are failing with these errors.

I wasn't present during the initial investigations so I'll let @coop-tim update you on that.

coop-tim commented 4 months ago

Confirmed it's working for me following the new readme steps as well as a bin/obj delete. I thought I had followed all those steps multiple times but at least it works now. I'd probably add the bin/obj delete to your steps as the first step, in case people have already tried other things. Thanks so much for your help.