AdamEssenmacher / GoogleApisForiOSComponents

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

Firebase Crashlytics NuGet #7

Closed evgenyvalavin closed 6 months ago

evgenyvalavin commented 6 months ago

Hi!

The Release Monitoring dashboard of Firebase Crashlytics requires the minimum version of the Crashlytics SDK to be v10.8.0+. It would be nice to have an updated NuGet with the Crashlytics.

Thank you.

AdamEssenmacher commented 6 months ago

@evgenyvalavin I'll include an -alpha version in the next batch of updated bindings if you can help me validate / test them.

evgenyvalavin commented 6 months ago

@AdamEssenmacher yes, I'm up to test the nuget and help you.

I'm new to ios bindings. I hope to find some time in the future to dive deep at least a little bit.

evgenyvalavin commented 6 months ago

@AdamEssenmacher I've come across an interesting issue trying to build new Firebase NuGets with an old Xamarin one. For example:

  1. If a csproj contains only "AdamE.Firebase.iOS.*" NuGets I can build an .api fine.
  2. If a csproj contains "AdamE.Firebase.iOS.*" and "Xamarin.Firebase.iOS" NuGets the project doesn't build successfully.
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error: clang++ exited with code 1: [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked framework 'GoogleAppMeasurement' [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error : Undefined symbols for architecture arm64: [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :   "_APMAnalyticsConfiguration", referenced from: [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :       +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics.o) [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :   "_APMAppMeasurementOriginFirebase", referenced from: [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :       +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics.o) [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :   "_APMConsentSettings3P", referenced from: [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :       +[FIRAnalytics setConsent:] in FirebaseAnalytics(FIRAnalytics.o) [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :   "_APMFormattedEventName", referenced from: [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :       +[FIRAnalytics logEventWithOrigin:name:parameters:] in FirebaseAnalytics(FIRAnalytics.o) [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :   "_APMFormattedUserPropertyName", referenced from: [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :       +[FIRAnalytics setUserPropertyString:forName:] in FirebaseAnalytics(FIRAnalytics.o) [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :   "_APMIsAnalyticsCollectionDeactivated", referenced from: [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :       +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics.o) [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :   "_APMIsAnalyticsCollectionEnabled", referenced from: [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(1560,3): error :       +[FIRAna [/Users/runner/work/1/s/src/Mobile/iOS.csproj]
jhartzel commented 6 months ago

What's up - I'm running into the same issue as @evgenyvalavin. Will be looking into this further today. Can also assist with validation & testing once ready.

PS: @AdamEssenmacher You're the man for forking this repo and taking this on. Not all heroes wear capes (unless you do).

AdamEssenmacher commented 6 months ago

If a csproj contains "AdamE.Firebase.iOS.*" and "Xamarin.Firebase.iOS" NuGets the project doesn't build successfully.

Yeah this is always going to be the case.

Anything Xamarin.Firebase.iOS. has a dependency on Xamarin.Firebase.iOS.Core. Likewise, anything AdamE.Firebase.iOS. has a dependency on AdamE.Firebase.iOS.Core. Xamarin.Firebase.iOS.Core and AdamE.Firebase.iOS.Core pack the same set of common Firebase/Google native libraries, so they cannot be included in the same project. They're fundamentally incompatible. This means that any other 3rd-party plugins/packages out there (i.e. Plugin.Firebase, Shiny, certain barcode scanners...) that use these dependencies all need to agree on importing these native libraries from a central authority, which used to be Microsoft and is now just some random dude in Ohio >.<

This situation is exactly what I warned about in the MAUI thread where Microsoft abandoned these components and pointed us over to that slim binding demo library, where I opened an issue pointing out the same that was (quite rudely) shut down.

evgenyvalavin commented 6 months ago

Something is not right with the Crashlytics NuGet. My app crashes in 1-2 seconds after startup as soon as I've added the NuGet. Full report is in the file crashlytics_crash.txt

Upd. Found this

2024-04-26 09:43:48.937832+0300 App.iOS[88865:7604547] error: Failed to load AOT module 'Firebase.Installations' while running in aot-only mode: doesn't match assembly.
Managed Stacktrace:
=================================================================
=================================================================
          at <unknown> <0xffffffff>
          at <unknown> <0xffffffff>
          at UIKit.UIApplication:xamarin_UIApplicationMain <0x00007>
          at UIKit.UIApplication:xamarin_UIApplicationMain <0x00007>
          at UIKit.UIApplication:UIApplicationMain <0x00063>
          at UIKit.UIApplication:UIApplicationMain <0x00063>
          at UIKit.UIApplication:Main <0x0013b>
          at UIKit.UIApplication:Main <0x0013b>
          at App.iOS.Program:Main <0x00097>
          at App.iOS.Program:Main <0x00097>
          at System.Object:runtime_invoke_dynamic <0x00127>
          at System.Object:runtime_invoke_dynamic <0x00127>
evgenyvalavin commented 6 months ago

10

evgenyvalavin commented 6 months ago

Same with 10.20.0-alpha1

<_ExportSymbolsExplicitly>false is set in the csproj
AdamEssenmacher commented 6 months ago

Please try adding a dependency on Installations and see if that helps or not. I got 10.20 Crashlytics to work.

evgenyvalavin commented 6 months ago

Updated to 10.24.0. Everything works fine. Thank you @AdamEssenmacher!