Googleplayservicescomponents: GoogleServicesJson BuildAction missing

Created on 8 Sep 2016  路  12Comments  路  Source: xamarin/GooglePlayServicesComponents

Xamarin.Android Version ( 6.0):

Operating System & Version (Windows 10 VisualStudio 2015)

Google Play Services Version (9.4.0)

Describe your Issue:

If I use the FirebaseMessaging quickstart sample I see GoogleServicesJson BuildAction is available when I selecet the google-services.json file in the project.

However, according to @Redth 's comment in this thread I just need to add the nuget package for Xamarin.GoogleServices.Basement and it should be available. I have tried this in new projects but I have been unsuccesful. Is there something else I need to do?

Steps to Reproduce (with link to sample solution if possible):

-Create a new project
-Add your google-services.json to the project
-Add the nuget package for Xamarin.GoogleServices.Basement
-Click on google-services.json and go to properties. The buildaction is not available and if you try to enter it manually an error appears saying "Property value is not valid"

Most helpful comment

The build actions can be a bit finicky right after you install a nuget package. Here are a few things to try:

  1. Try cleaning/rebuilding your project
  2. Try restarting Visual Studio
  3. Make sure that your .csproj has an entry which includes Xamarin.GooglePlayServices.Basement.targets

All 12 comments

The build actions can be a bit finicky right after you install a nuget package. Here are a few things to try:

  1. Try cleaning/rebuilding your project
  2. Try restarting Visual Studio
  3. Make sure that your .csproj has an entry which includes Xamarin.GooglePlayServices.Basement.targets

Rebuilding solved the problem, thanks again @Redth !

Easy way is to modify .csproj file in TextEdit by adding the following line
<ItemGroup> <GoogleServicesJson Include="google-services.json" /> </ItemGroup>
PS: I tried to clean/rebuild project or restart Xamarin IDE many times, but the results are not consistent.

would there be a .csproj in Xamarin.Forms? or would it be in my specific AppName.Android and Appname.iOS? I'm trying to use the Firebase Auth in both my iOS and Android versions of my app

download this Packages und restart 馃憤
image

image

@sulimanfarzat Thanks! Works for me!

I have error, but all Packages has been installed

image

image

@vitalina
Make sure build Action is GoogleServicesJson聽

I am unable to add the Xamarin.Firebase packages. It tells me it is incompatible with MonoAndroid 7.1. If I try to replace the Mono.Andoid.dll with the 8.0 version, it still just adds the 7.1 version.

@geedsen Try lowing the version of the Xamarin.Firebase package. That worked for me. Best of luck :)

Clean/Rebuild + VS Restart fixed it for me

I added the section in csproj



Was this page helpful?
0 / 5 - 0 ratings