I'm trying to implement the google play services in my app. I have successfully imported BaseGameUtils library from GitHub, referenced the GooglePlayServicesLib to the library, but it has a really annoying error...
This is part of the GameHelper.java file :
import com.google.android.gms.appstate.AppStateManager;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.games.Games;
import com.google.android.gms.games.GamesActivityResultCodes;
import com.google.android.gms.games.multiplayer.Invitation;
import com.google.android.gms.games.multiplayer.Multiplayer;
import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMatch;
import com.google.android.gms.games.request.GameRequest;
import com.google.android.gms.plus.Plus;
Everything is OK except the import com.google.android.gms.games.request.GameRequest; line which is underlined with the error message : com.google.android.gms.games.request cannot be resolved
I have no idea about how to solve this problem, and I see that the help community around google play games services is not as large as I would have bet...
any help would be welcome ! :)
I ran into the same problem. What fixed it for me was updating the google play-services library to a newer version.
Update the google play services library to the latest version. Thanks
Related
I'm using multiple different imports with Firebase:
import com.firebase.client.Firebase;
import com.firebase.ui.database.FirebaseListAdapter;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.ValueEventListener;
however, when I try to do
query.addValueEventListener
It doesn't recognize addValueEventListener. I've tried remaking the project and invalidating caches and restarting, but I'm still getting this error. What could possibly be wrong?
The appearance of this:
import com.firebase.client.Firebase;
indicates you are including the legacy Firebase SDK along with the "new" SDK. Not a good practice. Best to update your build.gradle dependencies to eliminate:
compile 'com.firebase:firebase-client-android:2.x.x'
If there are places in your code where you are using the legacy API, you can use the hints in the Upgrade Guide to migrate to the new API.
This should also resolve your other recent question.
I'm using Eclipse for android app development, but when I try make import of this lib import javax.imageio.ImageIO; Eclipse is shows me an error
"The import javax.imageio cannot be resolved"
. Pls. tell me what I have to do to solve this problem and import imageio lib to my project.
I am working on Android wear SDK in Eclipse,
I am unable import below line of code,
import com.google.android.gms.wearable.MessageApi;
import com.google.android.gms.wearable.Node;
import com.google.android.gms.wearable.NodeApi;
import com.google.android.gms.wearable.Wearable;
I also added google play services library to the build path, Any help will be appreciated.
I want to make a login with Google+ login button like this Tutorial
I have copied the codes, set google_play_services libraries, added package name and SHA1 key in google api console, but there are some import errors :
This import is not an error :
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.SignInButton;
import com.google.android.gms.plus.model.people.Person;
But this import an error (cannot be resolved) :
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.plus.Plus;
Anybody have a solution ?
Add this in yourbuild.gradle(app) inside dependency
compile 'com.google.android.gms:play-services:8.1.0'
[Solved]
I try to download new version of google-play-services library and import error is gone.
So, always update/download newest version of google-play-services library..
You need to add the dependency to your app.
Instructions for eclipse here
http://developer.android.com/google/play-services/setup.html
You can also do this by right clicking on your app (if you're using Android Studio) selecting Open Module Settings, going to the dependency tab. Then Clicking the "plus" at the lower left, select library dependency, then find play-services
I am trying to use Google's places API. I downloaded google-api-java-client-1.6.0-beta.zip library and I'm using source code from https://github.com/tuthan/Google-Place-Api-Demo
I import the external library in exactly the correct way, but the code still give me compile time errors on all imports of google-api-java-client-1.6.0-beta.zip.
e.g.
import com.google.api.client.googleapis.GoogleHeaders;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpResponseException;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.apache.ApacheHttpTransport;
import com.google.api.client.http.json.JsonHttpParser;
import com.google.api.client.json.jackson.JacksonFactory;
I've been working on this for a week, but have been unable to solve it.
The dependency jars are not in your classpath. Please add the jar from google-api-java-client-1.6.0-beta.zip to your sample project.