You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting an exception accessing any of the Crashlytics methods on iOS. I am also using Analytics too but that is working ok.
The exceptions take the following form:
NullReferenceException - Object reference not set to an instance of an object.
at Plugin.Firebase.Crashlytics.FirebaseCrashlyticsImplementation.Log(String message)
NullReferenceException - Object reference not set to an instance of an object.
at Plugin.Firebase.Crashlytics.FirebaseCrashlyticsImplementation.DidCrashOnPreviousExecution()
I've had quite a few issues inconsistent build and runtime errors integrating Crashlytics. I ran into the issue with the ObjCRuntime.__Registrar__ but uses the static registrar workaround. I tried the latest dotnet (9.0.200) as this should have fixed the underlying issue and avoided the workaround but it didn't.
I call the Crashlytics methods from a test page in the app so the CrossFirebase.Initialize() will have been called.
Here's the relevant content from my csproj
<!-- https://github.com/TobiasBuchholz/Plugin.Firebase/issues/372 that should no longer be needed with newer dotnet
but still wasn't working with 9.0.200 -->
<Target Name="SelectStaticRegistrar" AfterTargets="SelectRegistrar">
<PropertyGroup Condition="'$(Registrar)' == 'managed-static'">
<Registrar>static</Registrar>
</PropertyGroup>
</Target>
<ItemGroup>
<PackageReference Include="Plugin.Firebase" Version="3.1.3" />
</ItemGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
<!--https://github.com/xamarin/GoogleApisForiOSComponents/issues/643#issuecomment-1920970044-->
<_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
</PropertyGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
<BundleResource Include="Platforms\iOS\GoogleService-Info.plist" LogicalName="GoogleService-Info.plist"/>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<GoogleServicesJson Include="Platforms\Android\google-services.json" LogicalName="google-services.json" />
</ItemGroup>
Plugin.Firebase.Analytics.CrossFirebaseAnalytics.Current.LogEvent("Page OnAppearing"); //This is ok
//Both fail
Plugin.Firebase.Crashlytics.CrossFirebaseCrashlytics.Current.Log("Page OnAppearing");
Plugin.Firebase.Crashlytics.CrossFirebaseCrashlytics.Current.DidCrashOnPreviousExecution();
Any help would gratefully be received!
The text was updated successfully, but these errors were encountered:
Just looking at the plugin code, it looks like you'd experience this if the first call to CrossFirebaseCrashlytics.Current happens before FirebaseCrashlytics.SharedInstance is set:
I am getting an exception accessing any of the Crashlytics methods on iOS. I am also using Analytics too but that is working ok.
The exceptions take the following form:
I've had quite a few issues inconsistent build and runtime errors integrating Crashlytics. I ran into the issue with the
ObjCRuntime.__Registrar__
but uses the static registrar workaround. I tried the latest dotnet (9.0.200) as this should have fixed the underlying issue and avoided the workaround but it didn't.I call the Crashlytics methods from a test page in the app so the CrossFirebase.Initialize() will have been called.
Here's the relevant content from my csproj
My init code:
The specific methods:
Any help would gratefully be received!
The text was updated successfully, but these errors were encountered: