Y
Y
yabloki2013-12-09 00:52:42
phonegap
yabloki, 2013-12-09 00:52:42

How to connect google-play-services to a project?

I want to use oauth2, which is provided by the google-play-services library.
The project uses phonegap, so the build takes place not through eclipse, but through ant.
I'm trying to connect the library as it says in the manual.
Namely: 1) I copy the project lib from the SDK to the project folder
2) in my project I run android update project --target 6 --path "pathto/project" --library
"pathto/lib"
3) I add it to the manifest

<meta-data android:name="com.google.android.gms.version" android:value="4030500" />
(@integer/...chet version) doesn't resolve, it seems like it's a known problem of version 13 of this library.
At this point, the google manual ends, ant doesn't compile anything, says that it doesn't know these classes if I copy google-play-services. jar in the libs of my project, then ant compiles, but at runtime the getToken function crashes with an exception, and in the logcat I see The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
I suspect that somehow I'm doing a bad reference, and I'm throwing jar in vain. But I'm not sure of anything.
Send the second day, save our souls.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Somov, 2013-12-12
@yabloki

from those rakes that I
went through when building through the CLI
, everything is taken from the Project / www / folder and decomposed into project folders for platforms.
if you corrected config.xml then! (it’s not clear to me yet how) you have to add manifest.xml, config.xml and another xml with lines in the android project, js in the folder of the android itself should be replaced, js of connected plugins should be replaced, but the code itself will not be replaced with java - this is if you you use plug-ins, because of this leapfrog, I don’t collect through the CLI, and if you add a project on iOs, it’s generally dark.
Now I'm doing something like this
I'm doing a project
adding a platform

cordova platform add ios
cordova platform add android

I install plugins
cordova plugin add org.apache.cordova.media
... 
cordova plugin add org.apache.cordova.device-motion

after that, I don’t use the CLI at all
, I connect it to eclipse (I use ADT) \ project \ platforms \ android \
there and spend all the edits, with it,
or launch from under the CLI, overwrite the files and everything will break, it’s better not to do this.
Your problems may arise due to the fact that you make edits to manifest.xml which is here -project\platforms\android\ and it crashes with every build through the CLI that writes its configs
there.
maybe this is bad advice, but after the third rebuild of the project from scratch after the CLI killed everything, it’s somehow calmer =) if someone tells me how to straighten my arms more and the CLI will be grateful)

I
Ivan Somov, 2013-12-12
@jsom

I stopped collecting fongap through the CLI, it often makes jambs when its xml which in the Project / www / config.xml is shoved into the android project configs, especially if you put-remove plugins. Try to collect everything yourself exclusively for android in the android folder and build on eclipse.

Y
yabloki, 2013-12-12
@yabloki

mm but it will only compile android then? he must somehow take into account changes in www , no ? how can this be done without fongap's CLI?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question