Google Play Services are not being added - android

This question was asked a lots of time.
But I am facing a different problem that I have imported Play Services in the workspace; I have one project which is having Play Services and it is working fine.
When I am creating another project, It is not importing and showing the error.

You have to import the project and library with selection of option(copy in work space). If you are not checked option of copy in work space it will not be attach with your project.

Related

Xamarin Android Support lib references broken since installing Google Play Services

I have a project that I attempted to install Google Player Services through NuGet. Since trying to install the google package, my android support libraries as well as the google play service libraries are all showing up in my references as broken, no matter how I try to add, reinstall or change the references. They always break, throwing The "ResolveLibraryProjectImports" task failed unexpectedly. as an error in response.
I have looked around and tried everything that sounded remotely like my issue, to no avail. Any help would be appreciated.
I am running Xamarin v4.3.0.789 (4d2ed3d) with Xamarin.Android v7.1.0.43 (4a52f1e)
Not entirely sure why this fixed the issue. However after looking through, I realised that version of my packages had been updated, I assume that Google Player Services forced that, which then caused my whole project to go haywire.
Installed the version of packages I was using beforehand and it works again.

should I check in the Google Play services library project to source version control for GCM support?

I already added the support for GCM at our android app, however one thing bothers me is about the Google Play services library project. Based on this link Set Up Google Play Services SDK, I should do the following at step 4:
Make a copy of the Google Play services library project.
If you are using Eclipse, import the library project into your workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
We are using eclipse. So to allow other developer to build our app project without doing any manual work, I checked in the Google Play services library project into our version control (SVN) and add that project as part of our app project.
However I am not sure whether I should check that project into our source version control or not. One thing I also found out that google-play-services_lib.jar file is modified today, however I didn't do anything to that jar and I don't have any idea how it got updated. Should I check in the new version of the jar file? Again this still goes back to whether I should check in the Google Play services library project in the first place.
Could someone with GCM experience shed some lights what's the best approach here?
Update 1 at Jan 16:
Per the answer below, we could add a Google play services jar file to our app project, however based on this link, Implementing GCM Client, it has the following:
Caution: When you add the Play Services library to your project, be sure to add it with resources, as described in Setup Google Play Services SDK. The key point is that you must reference the library—simply adding a .jar file to your Eclipse project will not work. You must follow the directions for referencing a library, or your app won't be able to access the library's resources, and it won't run properly
So that would means that we could not just simple add the jar file.
Your library compiles first whenever you compile your application, as library projects create jar your Google Play Services jar will be updated on every run.
As the library incluse resources you cant create the jar and add them in to your java build path there two possible ways to get rid of this :
Move to Android Studio which uses .aar files which contains all your andorid resources in archive. Read more from refrence.
Prevent libray project to compile each and every time you run the app in eclipse. Click Here to know how to do that.

Google Play Services *with resources*

The guide to setting up GCM here: https://developer.android.com/google/gcm/client.html specifies:
Caution: When you add the Play Services library to your project, be sure to add it with resources, as described in Setup Google Play Services SDK.
Then the page it links to (https://developer.android.com/google/play-services/setup.html#Setup) never mentions the 'with resources' bit.
Does anyone know what this means, as I fear I've missed something when setting up my play services project.
With recources means as library project, not as JAR file.
Install the Google Play services from SDK manager.
After install it will be at /extras/google/google_play_services/libproject/google-play-services_lib/
So? you can copy this folder in you workspace? if you need.
If you are using Eclipse, import the library project into your workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
Add Referense to Google Play services in your project. Example http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject
Does anyone know what this means
I suspect that it is a clumsy way of emphasizing that you need to attach the Play Services SDK Android library project to your app, rather than just copying over some JAR.

The Google Play services resources were not configured

Before you read this, NOTICE:
I have done my research and have read other questions like the following
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included
and more,
the error I get is:
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included
I'm Using Eclipse
What they offered in other questions
updating all the packages & software
adding the library to the Java Build Path (I am using Eclipse)
using the Google API instead of the Android one (in project properties -> android)
none of these solutions seems to help, and I'm hoping maybe someone will have a better solution here
What Service I am using
I'm trying to use Google's GCM Service
so...anyone?
It happened for me when Location Service is not able to get the current location by any means - and setMyLocationEnabled(true) is called.
Have you placed the google library file in the location of your project file? Have you checked in the project properties that google play services library is included or not? Is it shows red cross before the googl play services library in properties dialog?

importing google play service reference to my map project

I Have a Android Map Project in Eclipse and Testing It Now debug Mode.Problem is that I am trying to add Google Play Service Reference to My Project.When i try import this Existing Code Into Work space from Eclipse and I Choose the Android SDK path Where Play Service is Installed and Press OK the I Show The Red Exclamation Sign On my Project.Is there any One Know What May Be the Issue and Any Other Right Way to add reference of Library. Plz Help
The Google BaseGameUtils should be defined as a LIBRARY project and you should add it as a REFERENCE in your project.
Please see the guide provided by Google at: https://github.com/playgameservices/android-samples/blob/master/README.md which I found to be reasonably accurate.
This may also help:
Google Play Game Services leaderboard - Unable to set jars up correctly in Eclipse
Good Luck !

Categories

Resources