Imported Project in Android Studio can't resolve ActivityRecognnitionClient - android

I imported a project from Eclipse to Android Studio. It uses Activity Recognition and Location Services. Now, this Android Studio project can resolve :
1) GooglePlayServicesClient(com.google.android.gms.common.GooglePlayServicesClient) and even
2) DetectedActivity(com.google.android.gms.location.DetectedActivity)
but can't resolve ActivityRecognitionClient(com.google.android.gms.location.ActivityRecognitionClient).
What might be the issue?

I think you are not including Google play services in your project structure properly. go to your project structure and Import the latest maven for google play services

Related

Error failed to resolve: compile 'com.google.android.gms:play-services-cast-framework:9.4.0'

tried to build a sample project after downloading from github.
But some errors showed up. Others solved but Couldn't resolve above issue mentioned in title.
Cast framework is required for this project but can't find it even after searching in project structure, shows nothing.
What can I do to resolve this issue?
Thanks.
Make sure you have set up Google Play Services SDK.
Start Android Studio
On the Tools menu, click Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support Repository, select Google Repository, and then click OK.
The latest version of play services is 10.0.1. Under the buid.gradle of your application module, write:
dependencies {
compile 'com.google.android.gms:play-services-cast:10.0.1'
}
and click on Sync.

cannot resolve symbol 'google' in android studio

var origin = new google.maps.LatLng( location.latitude, location.longitude );
The above code shows error as cannot resolve symbol google. which google api i have to use in order to resolve it.
In Eclipse goto File ⇒ Import ⇒ Android ⇒ Existing Android Code Into Workspace
Click on Browse and select Google Play Services project from your android sdk folder. You can locate play services library project from
android-sdk-windows\extras\google\google_play_services\libproject\google-play-services_lib
Importantly while importing check Copy projects into workspace option
Make sure you have added Google Play Services Library as Library
project.
if problem persists update your Google Play Service Library by SDK
Manager.
do Clean and ReBuild project.
please restart your Eclipse or andorid
studio,
refer :https://developers.google.com/maps/documentation/android-api/

Migrating eclipse project from github to android studio

I am in the process of migrating my current project from eclipse to studio which is present on github.
My project makes use of google play services lib and an another library (calendar lib to be precise)
I tried many ways of migrating to studio following the tutorials on the net but I am not able to achieve it.
I am getting problem with my Google play service library. The error is cannot find resource #integer/google_play_services_version
At this point of time I confused don't know Wat to do. Can some please tell me proper way of migrating.
It will be of great help. Thanks in advance :)
You are seeing the error in Android Studio? This should not be the case, as Android studio handles libraries through gradle dependancies. You can check your build.gradle for the dependencies. If you are seeing this error, I assume it is in Eclipse, which the link #SurajPalwe13 provided should help fix.
Migrating from Eclipse to Android Studio should be as easy as Importing the Eclipse project into Android Studio.
In Android Studio, File > Import > Select Eclipse project directory. Then a import wizard should come up.
Alternatively, you can export your Eclipse Project to contain gradle files:
In the latest version of Eclipse, Right Click Project > Export > Android > Gradle. Then follow through the export wizard. You should then be able to import the build.gradle file in Android Studio.

Android Studio import Google Play Services project refresh failed

currently I'm trying to import the Google Play Services for my Android project which is created using Android Studio. Now, I read the part where I should start from here and since this one is still using Eclipse I ended up in these steps. Now upon adding the Google Play Services on my app I receive an error saying:
Gradle 'MyApp' project refresh failed:
Could not find com.google.android.gms:play-services:5.0.77.
Required by:
MyApp:myapp:unspecified
So I tried changing the versions on this line:
compile 'com.google.android.gms:play-services:5.0.77'
into:
compile 'com.google.android.gms:play-services:5.0.+',
compile 'com.google.android.gms:play-services:4+',
compile 'com.google.android.gms:play-services:4.0.+',
so on but still getting the same error (only the version changes).
As for reference my Android Studio Version is currently # 0.5.2 (I cant update yet)
Grade ver 0.9.+.
And the screenshot of my installed packages in Android SDK Manager:
Now I'm wondering where exactly my problem is. And additionally I don't want to download a JAR file of the Google Play Services to solve this. I want to stick on the official way for implementing this in Android Studio. :D
Install Google Repository from the SDKManager.If you can't find Google Repository then update your SDK Tools,SDK Platform Tools,SDK Build Tools from the Tools section

Google play services induces errors in my project

I am trying to add a Google+ sign in button in my app so that I can use the youtube API and provide an easy access to the user. However recently I updated my sdk and now on importing the google-play-services_lib in my workspace and further integrating the services in my project using the standard importing procedure (Project --> properties --> Android | add library) results in an red exclamation mark on my project and when I try to run it gives me a dialog which says there are errors in the project)
In Java build part I get an error which can be properly explained by the following screen shot:
How to resolve this issue? I am sure of the path.
Delete play services library from sdk (.../sdk/extras/google location )
Open SDK Manager and re-install play services library. Restart SDK Manager again to take effect.
Go to eclipse--> re-import play-services library from sdk (copy into workspace is optional).
Clean library project by project-->clean option
Go to your project, add this latest imported library to it.
Clean both library project and your project.
This should work..

Categories

Resources