Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LogCat message: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included

I have an application that uses the Google Maps Android v2 API. I've added the google-play-services_lib library project to my workspace and added a reference to it from my application project, following the instructions on these pages:

  • http://developer.android.com/google/play-services/setup.html.
  • https://developers.google.com/maps/documentation/android/start

Everything seems to work fine: The app displays maps and overlays with the default markers. So I'm pretty sure I've got the Google Play services and Google Maps API stuff set up correctly.

However, I see this message in the ADT LogCat window whenever the map view is initialized (on a 2nd-gen Nexus 7):

The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

The message level is Error, and the tag is GooglePlayServicesUtil.

This seems benign, as my app does work fine. But what can I do or check to try to address whatever the problem might be?


Further info: Each time the "Google Play services resources were not found" message appears in LogCat, it is preceded by these messages, which are Warnings and tagged ResourceType:

getEntry failing because entryIndex 906 is beyond type entryCount 3

Failure getting entry for 0x7f0b038a (t=10 e=906) in package 0 (error -2147483647)

FWIW, I can't find the constant 0x7f0b038a anywhere when I search the projects, including the gen/R.java files.

I've checked the contents of the generated .apk, and it includes all of the resources that are in the google-play-services_lib/res directory.


Another update: After adding ActionBarSherlock and updating the targetSdkVersion in my manifest from 8 to 17, I now see another error in the LogCat output:

Could not find class 'maps.af.k', referenced from method 'maps.ag.an.a'

More details about that problem can be found here: Google Maps works fine on Android but I still get an error "Could not find class 'maps.i.k', referenced from method maps.z.ag.a"

And once again, the app seems to work just fine. Maybe it's safe to ignore these "errors"?

like image 331
Kristopher Johnson Avatar asked Aug 05 '13 22:08

Kristopher Johnson


4 Answers

Google Mobile Ads SDK FAQ states that:

I keep getting the error 'The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.'

You can safely ignore this message. Your app will still fetch and serve banner ads.

So if you included the google-play-services_lib correctly, and you're getting ads, you have nothing to worry about (I guess...)

like image 127
grebulon Avatar answered Nov 20 '22 17:11

grebulon


This is a bug in the Google Play services library, and it is filed here under issue 755.

Unfortunately, there isn't any solution yet.

like image 31
Hisham Muneer Avatar answered Nov 20 '22 15:11

Hisham Muneer


I just ran into this problem this morning and seemed very strange since my application was working fine up until today. I was getting the exact same "The Google Play services resources were not found..." message.

I tried opening the regular Google Maps application to see if I could get my location, but it wouldn't find it. Even after waiting 5 minutes, which is more than enough time to normally get a location from even the service provider via cell tower. So I checked Location Services.

Anyway, the problem turned out to be that on my S3 under Location Services -> Google Location Services. It was not checked. The other two location options were checked (VZW Location Services and Standalone GPS Services), but the last one, Google Location Services was not. After turning that on, the regular Google Maps could find my location and my application could find my location and the problem went away.

The error message pops up due to:

mMap.setMyLocationEnabled(true);

when Google Location Services is not enabled.

After doing some more testing it looks like if the current location is null (cannot be determined from all sources) then you will get this error when trying to turn on setMyLocationEnabled.

like image 40
shroge Avatar answered Nov 20 '22 15:11

shroge


I have decompiled Google Play services revision 14 library. I think there is a bug in com.google.android.gms.common.GooglePlayServicesUtil.class. The aforementioned string appears only in one place:

public static int isGooglePlayServicesAvailable(Context context) {
    PackageManager localPackageManager = context.getPackageManager();
    try {
        Resources localResources = context.getResources();
        localResources.getString(R.string.common_google_play_services_unknown_issue);
    } catch (Throwable localThrowable1) {
        Log.e("GooglePlayServicesUtil", "The Google Play services resources were not found. "
                + "Check your project configuration to ensure that the resources are included.");
    }
....

There is no R.class in com.google.android.gms.common package.

There is an import com.google.android.gms.R.string;, but no usage of string.something, so I guess this is the error - there should be import com.google.android.gms.R;.

Nevertheless the isGooglePlayServicesAvailable method works as intended (except of logging that warning), but there are other methods in that class, which uses unimported R.class, so there may be some other errors. Although banners in my application works fine...

like image 32
kreker Avatar answered Nov 20 '22 16:11

kreker