0

I am very new to android game development and I want to add Google Play Services lib to my project. I downloaded Google Play Services rev 25 copied it to my sdk> extras> google and imported the google play services library to my project. I also copied it to my work space by checking that box. I also checked whether the Library is actually a library or not by going into properties of the imported project. Then, I went to my android project > Properties > Android > Add to add the google play services library but it was not present there and the project selection window seemed to look disabled. I cleaned, restarted, and reinstalled eclipse and google play services several times but nothing proved effective.

I am attaching some pictures of my project. Please advice me so that I can move on with my first project.Google Play Services Library Properties

My Android Project Properties [My Android Project Manifest][3][Google Play Services API 25 Manifest][4]

  • Possible duplicate of [Importing google-play-service library showing a red X next to this reference android](https://stackoverflow.com/questions/17611017/importing-google-play-service-library-showing-a-red-x-next-to-this-reference-and) – Abhishek Aryan Jun 19 '17 at 05:23

2 Answers2

0

Finally after struggling with eclipse for almost a day, I found out that eclipse was using standalone JRE instead of JDK that comes with JRE. So I added the JDK to my eclipse project and then went to windows>preferences>gradle>arguments>and set the workspace JRE to newly added JDK.

I do not know whether this is the real solution or not, but I was able to add google play services to my project after doing this.

Hope it helps.

0
  1. Go to file {PROJECT_FOLDER}/build.gradle and add following classpath:

buildscript { .... dependencies{ .... classpath 'com.google.gms:google-services:3.0.0' } }

  1. Go to file {PROJECT_FOLDER}/android/build.gradle and add following dependencies/plugin:

dependencies { ... compile 'com.google.android.gms:play-services-gcm:10.2.0' } apply plugin: 'com.google.gms.google-services'

also remember to install Google Repository in your SDK Manager.

mk_
  • 179
  • 1
  • 4