unable to add google-service.json to project

KimJensenKimJensen USMember ✭✭

Using Visual Studio 2017 Pro.
I'm trying to create the project "Remote Notifications with Firebase Cloud Messaging" found in the Xamarin Android Application/ Fundamentals/ Notifications. It say to add the google-service.json to the project folder. I add it in the Projects/FCMClient folder. Then it says: 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).
I right click the google-services.json in the Solution Explorer, but I do not get an option that says Include in Project. I have add, but it only gives me new file, new item or new folder.
I'm stuck, thanks for any help.

Posts

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Can you add a screenshot showing what you are describing? Is the file physically present in the project folder?

  • KimJensenKimJensen USMember ✭✭

    I was able to add it by selecting Project and Add Existing Item from the menu.

    As you can see there is no option if I right click the file name in the Solution Explore.
    I was not able to get the FCM to work. I get a token but it is not registered and when I add the code to see if the json was implemented I just get a 6 digit number.

  • terzyterzy Member ✭✭
    edited November 2018

    @KimJensen
    I Realy need you help with this.
    I have followed a step by step

    And it say

    • Open context menu on google-services.json file.
    • Select GoogleServicesJson in Build Action.

    https://drive.google.com/open?id=1Rv0rDiwddMEanzovERO0UmVa97Y3XVz4

    but im using Windows, dont know if its why but i cant follow the step by step for it becouse it dosent exists.
    the Build Action

    How did you solve this. Please help im really stuck

    Iv heard something about a nuget that need to be installed
    Xamarin.GooglePlayServices.Basement
    but cant get it to work

    (

    Xamarin.GooglePlayServices.Basement 42.1001.0
    Note that all of the Xamarin.GooglePlayServices and Xamarin.Firebase packages show up with yellow caution symbols under project References.
    )

    Cant find more then the basement in the reference in the android
    but in the Cross project i get this when i install
    Severity Code Description Project File Line Suppression State
    Error NU1202 Package Crosslight.Xamarin.Android.Support.Annotations 25.3.1 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Crosslight.Xamarin.Android.Support.Annotations 25.3.1 supports: monoandroid70 (MonoAndroid,Version=v7.0) *.csproj 1

  • GerryHGerryH USMember ✭✭✭

    terzy, any progress?

    I get the "not compatible" problem if I try to add google play services to my shared library. My project is a shared library, an Android app and an iOS app. That library should only be included in the Android app.

  • kasunwanniarachchikasunwanniarachchi Member ✭✭
    edited July 8
    1. Copy the google-services.json to your solution Droid folder
    2. Go to vs solution explorer and right click on Droid project -> Add -> Existing Item (it will added to the solution)
    3. Then Right click on google-services.json and go to properties
    4. In the Properties pane, set the Build Action to GoogleServicesJson
Sign In or Register to comment.