Forum Xamarin.Android

I didn't find "GoogleServices.Json" in the Build Action?

I'm trying to add firebase in my project and "GoogleServices.Json" in the Build Action?

Answers

  • YelinzhYelinzh Member, Xamarin Team Xamurai

    How to add the Google Services JSON file:

    • Copy google-services.json to the project folder.
    • Add google-services.json to the app project (click Show All Files in the Solution Explorer, right click google-services.json, then select Include in Project).
    • Select google-services.json in the Solution Explorer window.
    • In the Properties pane, set the Build Action to GoogleServicesJson.

    If the GoogleServicesJson build action is not shown, save and close the solution, then reopen it.

    Tutorial: https://docs.microsoft.com/en-us/xamarin/android/data-cloud/google-messaging/remote-notifications-with-fcm?tabs=windows#add-googleplayservices-json

  • abcr_1abcr_1 Member ✭✭
    edited December 2020

    Saved, closed, reopened - still no GoogleServicesJson Build action shown. What then? Am I missing any extensions in VS? - Update:
    Install Xamarin.GooglePlayServices.Basement Nuget into your Android project and then close and open the solution. You will find the option now.

  • DevologyDevology GBMember ✭✭✭

    Install Xamarin.GooglePlayServices.Basement Nuget into your Android project and then close and open the solution. You will find the option now.

    Thanks @abcr_1 - I added Xamarin.Firebase.Messaging and then the build action started working for me. I do reference a push client project which does reference the NuGet but I'm guessing Visual Studio doesn't traverse the project dependencies to conclude what build actions are valid. I'll be trying to remove the NuGet once I've proved its working (it builds without it, so compilation detects the client project NuGet dependency, but not the IDE for build actions).

Sign In or Register to comment.