Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't build project for google app invites

Tags:

android

gradle

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.

like image 677
Rui Santos Avatar asked Jun 02 '15 11:06

Rui Santos


1 Answers

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?

like image 138
Montaner Avatar answered Oct 19 '22 19:10

Montaner