question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default Firebase App Not Initialized, but not clear how to add package explicitly [Android]

See original GitHub issue

If you receive an error that states the default Firebase App is not initialized, adding one package explicitly seems to resolve this issue (it doesn’t seem to matter which package gets added).

I am getting this error but am not to sure what it means to “add the package explicitly”.

I have the Plugin.Firebase package installed via nuget, and everything works great in iOS. In Firebase Console I can see the analytics register for IOS when I open the app. But android is giving this error at runtime, and no Firebase Analytics seem to register at all.

Screen Shot 2022-10-04 at 1 09 59 AM

here are some possibly related lines a few lines beforehand.

Screen Shot 2022-10-04 at 12 57 14 AM

I tried adding Xamarin.Firebase.Analytics package 120.1.2 via Nuget. Didn’t seem to do anything. Here is relevant entry in CSPROJ

    <ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
	<GoogleServicesJson Include="google-services.json" />
	<PackageReference Include="Xamarin.Firebase.Analytics" Version="120.1.2" />
</ItemGroup>

Any help explaining what “adding the package explicitly” means would be helpful!

Details: .Net Maui, running in android emulator on Mac

On iOS, I get the following message, no errors : 8.10.0 - [Firebase/Analytics][I-ACS023007] Analytics v.8.10.0 started

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
AdamBebkocommented, Oct 6, 2022

I Finally figured it out. Exasperated, I created a fresh app, and tried to find the source of the issue. The issue was that the package name (i.e. com.me.myapp) was different in the CSPROJ file compared to the google services json’s package’s. I guess Visual Studio puts in some filler there, rather than the correct package name.

In .csproj:

		<!-- App Identifier -->
		<ApplicationId>com.me.myapp</ApplicationId> <!--  FIX THIS -->
		<ApplicationIdGuid>LOTS-OF-HEX-NUMBERS-AND-DASHES-REDACTED</ApplicationIdGuid> <!--  THIS DOESN"T SEEM TO MATTER -->

I was able to view debug events from analytics and everything now. Thanks so much for the awesome package. Looking forward to playing around with Firestore now.

Sorry for the noob mistake. If I get some time, I will do a PR to add that info in the setup readme to help future MAUI noobs like me.

0reactions
JoshZAcommented, Oct 14, 2022

This is gold, please add to the official docs @TobiasBuchholz

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default FirebaseApp is not initialized in this process. Make ...
Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first. i have tried with many ...
Read more >
Default FirebaseApp is not initialized in this process. Make ...
This error happens immediately whenever I run the android version of my project. iOS has no issues. I know V3 is coming and...
Read more >
FirebaseApp - Google
Any FirebaseApp initialization must occur only in the main process of the app. Use of Firebase in processes other than the main process...
Read more >
Known issues with Android Studio and Android Gradle Plugin
This page tracks known issues with Android Studio Giraffe and Android Gradle plugin 8.1.0. If you experience an issue not already included here, ......
Read more >
Resolved: Default FirebaseApp is not initialized in this process ...
Firebase Issue Crashes App Resolved. Default FirebaseApp is not initialized in this process( App ID). Make sure to call Firebase.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found