Error while using cocos framework with Google Play Services

I am working on a game using cocos framework prebuilt libraries on Android & iPhone. When i tried to implement google play game services & admob i faced a weird issue after running the compile command.

Before running the command google play services project is there in Android Dependencies. But after running the command it says google play services is missing from dependencies due which it gives error while running the project in eclipse.

While running compile command there are many google play services related errors in log such as below

error: package com.google.android.gms.ads does not exist
error: package com.google.android.gms.games does not exist

Screenshots from eclipse before & after running the command are attached. Compile command log is also attached. Can anyone guide me solving this issue.

There is a lot possible variantions what happened.

What I can say if you compile project using cocos console comand it makes project lib files incompatible with eclipse. So after compile you need to make project refresh in eclipse to make it work again and see all attached libs. Just do everytime refresh when launched console.

BTW. that why we moved to android studio I recommend you to move also.

Try using Cocos Helper http://sonarsystems.co.uk/cocoshelper.php

But build is failing due to these errors on cocos console. Before running the command game services lib is there in target. During compilations something goes wrong & it can’t find google play services. Check attached screenshot.

I haven’t tried studio so far. Will try this after i am done with this project.

Ok Farhaan. I will try this & let you know if it solves the problem :smile:

1 Like

:smiley: :smiley:

OK, then you should know :slight_smile: that when you add libs thru Eclipse they not always available thru cocos console, like they are not included in build, that why it saying this. Try Gradle + Android Studio it is much easier, just add dependecncies for google play and it will work.

+1 for using gradle + android studio, you can also specify which parts of google play services you want to use, instead of including the entire jar file. For example say you only need it for the ads part you can add a line to the gradle file to compile only the ads module. it’s quite easy to set up.

Solved this issue by copying google-play-services.jar in jars folder of the project. Also added google-play-services project as dependency.

1 Like