GoogleAuthUtil cannot be resolved - android

I am using Google Play Service's Authorization with GoogleAuthUtil in my Android applcation. I did this part about 2 months back, its been working perfectly fine then onwards. Yesterday, I updated the SDK. Now I am getting this error in my application. It says "GoogleAuthUtil cannot be resolved".
Has anything changed in the updated SDK?
How can I solve this?
I am importing the following:
import com.google.android.gms.auth.GoogleAuthException;
import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.android.gms.auth.GooglePlayServicesAvailabilityException;
import com.google.android.gms.auth.UserRecoverableAuthException.
I am getting
com.google.android.gms.auth cannot be resolved.

Whenever you update any library make sure to first remove it from your references and again add it to your references. After that clean the project. Restart Eclipse if needed. And I feel then you are good to go!! :)

Just remove the <uses-library> tag from your AndroidManifest.xml and restart and clean everything. For sure it will start running.

If you are using Android Studio follow step below.
Open SDK Manager -> SDK Tool -> click on Google Play service and Apply
Open Module Setting or Project Structure -> on Dependencies tab click on + button -> select 1.Library Dependency ->Select play-services (...) then click OK
Clean your project by Build -> Clean Project

Related

The import com.google.android.gms.ads cannot be resolved

I am getting error when i want to import google-play-service in Eclipse.
i have import google-play-service-project-lib in Eclipse
i have read all possible Q&A but nothing is work.
I have it added as Library and JAR manually
Then I have tried to clean my project ...
Is there anybody who can solve this problem?
You can use this way. First of all close projects which are using google-play-services library. Whenever your mouse over the com.google.android.gms import that can not be resolved and towards the bottom of the popup menu, select the "Fix project setup" option as below. Then it'll prompt to import the google-play-services library.
Firstly, try to download latest version of Google Play Services, then:
Remove the existing library to add again manually,
Go to your java build path,
Under project tab add your library and then,
Under order & export tab tick your library,
Apply settings.
After all, just clean the project and library, it should work.
By the way, you can also check this question.
To me it was just a matter of updating the dependencies.
dependencies {
implementation 'com.google.android.gms:play-services-ads:20.6.0'
}
I concluded that if it's already on the latest version, refresh the Gradle may solve the issue - or, as already recommended by Umit Kaya, remove the existing library and add it back.

import com.google.android.gms.location.ActivityRecognitionResult cannot be cannot be resolved

I was working on the latest Google API for detected activity. So Inorder to try that I download the sample code from
http://developer.android.com/training/location/activity-recognition.html
I imported the google-play-service-lib. have set it as a library for my project. I have also checked for required permissions, but I am still getting an error. I have also set target build to Google APIs
import com.google.android.gms.location.ActivityRecognitionResult cannot be cannot be resolved.
I was able to import other samples from google play services folder and they are running fine. Can anyone point out what error I am making ?
Ok I was able to fix it,....after reinstalling and adding and removing google play services for several times.
R u sure added the googleplayservices library if added check both are in same folder(path) are not by opening the project -> properties -> resource

Android The import com.google cannot be resolved

I'm trying to test LocationService example of Android developer as per following link http://developer.android.com/training/location/retrieve-current.html. At that time, error message show me that "The import com.google cannot be resolved" for following 5 lines. I'm really confused how to solve this problem.
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.location.LocationClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
You will need the Google Play Services SDK configured within Eclipse and import google play services as library will dismiss this error .
There is a much simpler solution. In my case, I've gone through all the answers from a few sources and none of them give a straight answer to my problem. Finally, I found a sample app source code and when I import the source code I found out adding the library from Google Play Service Library directory solved it. Google Play Service Library is located (for windows user) here:
\sdk\extras\google\google_play_services\libproject
Import the library into Eclipse as a library project and add this library in your actual project will fix it.
EDIT: This guy made a great contribution on his tutorials how to use Android Google Map v2 step by step and very details. It also includes how to use with Android Support package’s backport of fragments.
http://ddewaele.github.io/GoogleMapsV2WithActionBarSherlock/part1
Assuming you use Eclipse.
Right-click on your project -> properties -> Android.
There use Google API's instead of standard Android.
If you're using Android Studio:
Right click on your app folder -> Open Module Settings -> Dependencies -> Click on the plus button -> Choose library dependency -> Search for "play-services" -> Double click on the com.google.android.gms:play-services
Press Ok and wait for Gradle to rebuild.
You can use this way. First of all close projects which are using google-play-services library. Whenever your mouse over the com.google.android.gms import that can not be resolved and towards the bottom of the popup menu, select the "Fix project setup" option as below. Then it'll prompt to import the google-play-services library.
If you're using Eclipse, you can fix this by installing Google Play Services SDK via the SDK Manager, load the google-play-services-lib project into Eclipse, and set this as a reference from your project. This is documented at http://developer.android.com/google/play-services/setup.html
Do you use android sdk with google api? If not, do that and it will work.
set your project properties to google api.
You will need the Google Play Services SDK configured within Eclipse.
Maybe useful for some other developers facing this error:
If you are changing to a newer Android Version and if you are using the android-support-library, you have to beware that all projects that you use as library also have the SAME version of the android-support-library. One example would be the actionbar-sherlock. ;)
It Works = Do you use android sdk with google api? If not, do that and it will work.
In project.properties I had to add the following (for ANT build):
android.library.reference.1=${root_prefix}/${sdk.dir}/extras/google/google_play_services/libproject/google-play-services_lib
If you are using Android studio you may be missing to add gradle to your project.
Add specific play service you want.
Here you may want to compile
com.google.android.gms:play-services-location:10.2.1
Add this to your build.gradle app module in dependencies.
In android studio,add dependency as follows:
In gradle script,go in build.gradle(Module:app) and add these lines
compile 'com.google.android.gms:play-services:10.0.1' in dependencies tag
Here 10.0.1 may be skipped or changed according to your library installed

android Programming by using Eclipse Indigo Service Release 2

I'm a beginner of Android Application development need to practice by examples and samples given in the book "Beginning with Android" by Wei Meng Lee, but whenever I try to follow those steps I come across a few errors unable to clean them. The Error seems like this:
" setContentView(R.layout.activity_main);" Don't know what type of error is it. In my computer I've installed SDK API level 16 that is for Android 4.1 What to do? Please guide me through appropriate answer.
Remove import
import android.R;
Than clean build your project also check xml layout file name in
setContentView(R.layout.activity_main);
than it'swork fine.
You should get the latest version of eclipse. Its now Eclipse Juno.
And check your import.
Remove
import android.R;
Instead put
import android.packagename.R;

Eclipse cannot import jtwitter-yamba.jar in learning android

Im using Eclipse Juno and ADT 20 v2 My Yamba app which has no errors forces close immediately it is launched
My Logcat shows me in the Yamba app
Could not find class "winterwell.jTwitter.Twitter" referenced from method com.marakana.yamba.StatusActivity.onCreate
I know many people here used Yamba to learn Android programming and d Oriellys site has no solutions
Is it the "Twitter("student","password") API root.." That is causing this?
I was able to solve this error by doing the following in Eclipse:
Project -> Properties -> Java Build Path -> Order and Export
then select "[x]jtwitter-yamba.jar - /path/to/jar"
Before it worked though, I had to do:
Project -> Clean...
Then ctrl-F11 to rebuild
Try using the latest version of normal JTwitter. I think it's compatible with Yamba. You need to call Twitter.setAPIRootUrl() to point it at Yamba instead of Twitter.

Categories

Resources