8

I'm trying this Google app invites thing but i cant get it to work.

I followed the steps just like https://developers.google.com/app-invites/android/guides/app suggested but i soon encountered the problem of not finding 'com.google.gms:google-services:1.0' and so i followed Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio and gradle continued to build but then i encounted this error:

enter image description here

i followed this answer: Android Studio: failed to complete gradle execution, cause is empty and even tried with the option -Xmx512m but the problem persists... Anyone with similar issue trying to build put app invites in their app and not be able to even build the project?

Edit: I didn't manage to solve the issue, but i did manage to get app invites to work. I didn't need to do these steps from the App Invites google guide:

Add the dependency to your project's top-level build.gradle: classpath 'com.google.gms:google-services:1.3.0-beta1' Add the plugin to your app-level build.gradle: apply plugin: 'com.google.gms.google-services'

And like so, gradle wouldn't fail to complete because i only needed to add the google play services dependency to the app level build.gradle file.

Community
  • 1
  • 1
Rui Santos
  • 537
  • 3
  • 15
  • Hi, did you manage to solve this? I have the same issue – Lunchbox Jul 02 '15 at 13:28
  • I didn't exactly solve the issue. I just did not add the google-services:1.3.0-beta1 and the plugin so the error didn't occur and the google app invites still managed to work! – Rui Santos Jul 06 '15 at 11:07

3 Answers3

1

I have solved this issue by not including the entire play-services. Instead of:

compile 'com.google.android.gms:play-services:7.5.+'

type this:

compile 'com.google.android.gms:play-services-appinvite:7.5.+'

By the way, you said you solved your problem by not using the google-service plugin. Have you checked you are able to send invitations? If the plugin does not load the configuration file how does it work?

Montaner
  • 522
  • 5
  • 16
  • I use many other services from the play-services so i figured i just include the whole bundle. I have the configuration file setup and in the correct place. And yes, i'm able to send invitations and i'm also receiving them. I guess maybe including the dependecy is enough? – Rui Santos Jun 15 '15 at 16:50
  • If you can avoid to include the whole bundle it's better. – sivi Mar 16 '16 at 21:49
0

Try changing it to com.google.gms:google-services:1.3.0-beta1. That's what works with the sample.

Andy
  • 2,374
  • 3
  • 17
  • 20
0

Try checking your repositories in your build.gradle file. It seems the dependency is on jcenter and not mavencentral. Replace mavenCentral() with jcenter(). This worked for me.

Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141