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

22

321

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:

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"?

Solar answered 5/8, 2013 at 22:8 Comment(20)
Are you building using the Eclipse builder, Gradle, or Maven?Hipolitohipp
Using the Eclipse builder.Solar
Happening the same here, using Gradle + Android Studio! 08-06 19:47:00.376 2141-2141/com.menor.android.assignment.tempos21 E/GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.Poleaxe
Try cleaning all of the projects in your workspace (under Project > Clean). I've noticed that this sometimes fixes R.java/resource issues.Hipolitohipp
Same thing is happening here, clean didn't help. I think it started after I updated stuff in the android sdk managerRalaigh
Same thing here (Eclipse as well), it most likely is because of the latest SDK update (22.0.5). Today Google Play Services was updated to rev10, but I still have the error message. What's even worse; my Google Maps Fragment has stopped working It doesn't want to display any map, only an endless blue canvas.Scenery
I have the same problem using android studio. I'm using google play services as a dependency using google maven repository. Everything seems to work fine, but the error is there. Anyone found a solution?Reconstructive
error -2147483647 = 2^31 -1, which makes me think there's something broken in whatever code is writing this error to LogCat.Perceptive
I am having the exact same issue here as the original question. I am using eclipse with google play services added as a project. Any one found a solution yet?Riles
I have builded my App using eclipse and Maven and in the two situations I get this error. Can this be a problem with the google play service lib?Scapegoat
i am experiencing this also.. any update on how to fix this? thank youSandfly
The issue really has nothing to do with google maps itself because I get the same error in my app and I do not use google maps at all. The problem lies within the library itselfFundamentalism
I have the exact same problem when using adMob. But out of 100+ launches, the test-ad has showed up two times.. Strange!Katharynkathe
I can't believe there are this many answers. It amazes me that google doesn't test this stuff more thoroughly.Solve
Hi All, I am getting the same error in logcat. Weird thing is this that i am properly using google play services in my app after that facing this issue. I am getting this error while trying to use the smart dfp banner ads in my app. Pls do some help.\Reciprocal
Goggle says "You can safely ignore this message. Your app will still fetch and serve banner ads."Tolmann
@Sufferer do you have any official link/message to this statement?Brownie
@Brownie official FAQ developers.google.com/mobile-ads-sdk/kb/#resourcesnotfoundTolmann
I had this issue too. I had the dependency in IntelliJ set to the library itself rather than the module (library project in its entirety). Once I had the dependency on the library project it worked fine.Sashasashay
Updated the link for the "can be safely ignored": developers.google.com/mobile-ads-sdk/docs/admob/android/…Plasty
R
50

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.

Raffinose answered 12/4, 2014 at 11:44 Comment(2)
This post dates back to 2014, I am getting this error right now, is this post relevant?Orthography
@sachithkn weird enough, I had problems in my code, on inspection and debugging I found that out. Instead of showing error in my code it crashed at API level, probably I did some bad code by adding try-catch somewhere which forcefully ran the code, eventually crashing at API call (or in API). So I fixed my code and error is gone. At least this is what I think happened.Orthography
V
88

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...)

Vere answered 13/4, 2014 at 16:2 Comment(5)
maybe you can ignore, but I keep getting into a code that doesn't exist, each time I choose to debug the app.Hypertensive
What if I'm not using ads? Would Google Play Services still be trying to do whatever it is that generates the message?Solar
I see this also in a different app where I just register for GCM push notifications, and everything seems to be working fine.Vere
when i run app in android emulator injected ads is displaying, but if i run same app into physical android device then it is displaying blank screenDarlenadarlene
This is my experience and opinion AlsoCharming
R
50

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.

Raffinose answered 12/4, 2014 at 11:44 Comment(2)
This post dates back to 2014, I am getting this error right now, is this post relevant?Orthography
@sachithkn weird enough, I had problems in my code, on inspection and debugging I found that out. Instead of showing error in my code it crashed at API level, probably I did some bad code by adding try-catch somewhere which forcefully ran the code, eventually crashing at API call (or in API). So I fixed my code and error is gone. At least this is what I think happened.Orthography
E
36

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.

Einkorn answered 10/8, 2013 at 13:22 Comment(3)
This is the root of the issue from what I can tell as well. If you remove the call for setMyLocationEnabled(), you will no longer get the error. Even though its listed as an error, it seems to be harmless as the app continues to perform fine and the functionality to display my location in the application continues to work fine as well. Not sure why its coming up as an error.Should
setMyLocationEnabled has nothing to do with this, since on all of my devices Location Services are enabled in settings. I suspect the latest google-play-services.jar is broken.Letterperfect
My problem had a almost similar fix i needed to switch my location on in Android 4.4 you actually see the app which is requesting location, and my app was one of those. I guess its to do with setOnMyLocationChangeListener rather than setMyLocationEnabled which gives that error. There needs to be check of some kind before you can request location and check if location services are on. Should helpReefer
K
32

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...

Kratz answered 10/2, 2014 at 20:9 Comment(0)
S
20

You have to add the google-play-services-lib as a library-project. They updated the SDK. There are several tutorials around. For Eclipse it is easy:

Right click project -> properties -> Android

Enter image description here

For more detailed walkthroughs:

Importing the library-project

How to get GoogleMaps running on emulator

Spinster answered 8/8, 2013 at 9:54 Comment(4)
As stated in the question, I have added the google-play-services_lib library project, and everything is working fine.Solar
ok, you didn't explictly said that you use the google-play-services-lib as a PROJECT, so i tried to point it out. i will re-think the problem.Spinster
FWIW, I've looked at the generated .apk, and it does contain all the resources from the google-play-services_lib project, so I'm pretty sure the library project is added and referenced correctly.Solar
Do you know how to do the equivalent operation in Android Studio? I do not wish to import it with mavenTurnedon
B
12

I had this issue too. The way I solved it was the following:

  1. Delete the google-play-services_lib library-project.
  2. Remove the (now invalid) google-play-services_lib reference in [your project] > Properties > Android.
  3. Imported the google-play-services_lib library-project from android-sdk-x/extras/google_play_services/libproject. When you import a project, you get the option "Copy project into workspace". UNCHECK IT.
  4. Add the (now valid) google-play-services_lib reference to your project with [your project] > Properties > Android.

This did the trick for me. I hope it helps you too!

Bushhammer answered 21/9, 2013 at 14:18 Comment(2)
Just an FYI you shouldn't import google play services directly from the SDK. You should keep the "Copy project into workspace" box CHECKED if you do, or copy the directory into your workspace, or better yet into your version control system. Ran into this issue today where some devs were using an older version and some were using the latest and the project code was failing with the latest because it didn't have the newly required google maps meta data in the Manifest.Carrissa
Do you know how to do the equivalent operation in Android Studio? I do not wish to import it with mavenTurnedon
M
4

I am encounted this problem when I am using Admob JUST because I forgot to write my Ad Unit ID into @string.

Moult answered 31/12, 2013 at 9:43 Comment(1)
Where did you say you forgot to do that? I'm creating my adview programmatically, and passing such id programmatically too.Engelbert
L
3

I had the same issue. In the Google APIs Console, you should check that there is only one key generated for that app. I had a stretch where I migrated my code from one PC to the next and so on (it got messy), and had multiple keys for my one project. The older keys are all listed as inactive on the API console page, but for some reason caused a conflict. After deleting them completely, I ran it again and it worked.

Loathe answered 8/9, 2013 at 4:55 Comment(0)
R
3

As for me I've solved this problem by next way - as developer.android.com says, after adding google-play-services_lib you should add <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> in your manifest, but on the new SDK you'll always get an error:

Error: No resource found that matches the given name (at 'value' with value '@integer/ google_play_services_version').

To solve that error many people advise to use a raw value, 4030500, instead of @integer/google_play_services_version, but it is correct ONLY for Google services revision 13.

If you use any older version or version for Froyo (like me) you should put another value in it. To know what value you should put just open a Google Play services manifest and copy-paste a version_code value. For Froyo services, it is 3265130. After adding this I've stopped getting this error, and I've began to receive coordinates in my application at last.

Requite answered 7/12, 2013 at 15:21 Comment(2)
4030500 gave me an error. However the correct value to use was provided in the logcat.Twelve
@Twelve what is your google_play_services version? Check it in android sdk managerRequite
M
3

For me the only working solution was to add the android-support-v7-appcompat library as well. It seems that this library is also needed in order to get rid of that message. Since then my applications have been working fine!

I hope it helps!

Mcclurg answered 6/2, 2014 at 14:55 Comment(1)
This did not work for me what sdk did you compile your project for?Solve
D
2

I had the same issue here. As Magnus said above, for me it was happening due to an SDK update to version 22.0.5.

After performing a full update in my Android SDK (including Google Play Services) and Android plugins in Eclipse, I was able to use play services lib in my application.

Damle answered 10/8, 2013 at 22:10 Comment(0)
S
2

For IntelliJ IDEA users

After struggling for a couple of days, the only way to make it work in IntelliJ IDEA 13 was to import the library. Here are all the steps:

  1. Update Android SDK so the latest Play Service is installed.
  2. Go to the android-sdk-root/extras/google/google_play_services/libproject directory.
  3. Copy google-play-services_lib and paste it next to your IntelliJ IDEA project (some recommend using this directory directly, but I advise to keep this code clean!).
  4. Open IntelliJ IDEA project properties and add new Module google-play-services_lib.
  5. Check if it's marked as a Library.
  6. Add google-play-services_lib library project as a dependency to the main project.
  7. Add google-play-services library as a dependency library as well.

On the link I provided below, you can see an image of how it looks in my IntelliJ IDEA 13. It would not work without adding only one of these two.

PS. I asked a question, Why does IntelliJ IDEA 13 require both lib project and lib itself (google-play-service) to be added as a dependency?, why is it a must in IntelliJ IDEA 13, and why we cannot import either the library or project only.

Stanwin answered 10/4, 2014 at 10:27 Comment(11)
Could you list the exact manipulations you are doing to import the google-play-services_lib project as a module dependency (I use Android Studio 0.3.6)Turnedon
@RaphaelRoyer-Rivard Done! Note that these steps are for IDEA 13, not for Android Studio so some steps may differ, thou it should be the same.Stanwin
Actually, it's the operation 4 and 5 that causes me problems. I open the Project Structure with F4, then I go to Modules, click on the + and there is a popup window named New Module. Do I references the google-play-services_lib folder from here (in the Content root field)?Turnedon
@RaphaelRoyer-Rivard Just direct to the folder not JAR library. And add the whole project as a module. Is this what you asked?Stanwin
Well, it isn't simple as selecting a folder in my case. I must choose the Module type from this list (Java, Maven, Gradle, JavaFX Application, Command Line App, Groovy, Griffon, Gradle: Android Module, Gradle: Android Project, Gradle: Java Library). And then selecting a folder in the field Content root. Is Java the right Module type to choose?Turnedon
It's Java Android library project actually. So try with Java. The if need be reference the correct Android SDK. Cannot believe that AS tool is making this so complicating. PS. do you import from AS blank screen or from inside your existing Gradle project?Stanwin
I do not import the module, since there is no Import module function in AS 0.3.6. The only option is Add new moduleTurnedon
Whenever I try to add the module and build it, I get the following Gradle: module 'google-play-services' won't be compiled. Unfortunately you can't have non-Gradle Java module and Android-Gradle module in one project.Turnedon
@RaphaelRoyer-Rivard This exceeds my knowledge since I don't use Android Studio. Make a new questions on this. Someone will knowStanwin
See here: #17960815Pastrami
I am getting error - Error:(5, -1) android-apt-compiler: [google-play-services_lib] F:\AndroidProjects\google_play_services\libproject\google-play-services_lib\res\values-v21\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'.Kiethkiev
L
1

I also had the same problem. In starting, it was working fine then, but sometime later I uninstalled my application completely from my device (I was running it on my mobile) and ran it again, and it shows me the same error.

I had all lib and resources included as it was working, but still I was getting this error so I removed all references and lib from my project build, updated google service play to revision 10, uninstalled application completely from the device and then again added all resources and libs and ran it and it started working again.

One thing to note here is while running I am still seeing this error message in my LogCat, but on my device it is working fine now.

Latreese answered 15/8, 2013 at 9:26 Comment(0)
S
1

I also had the same issue. I also tried to look for solutions, but after I didn't find any of the solutions working, I tried to restart my mobile (Android device), and it resolved the issue.

Please give it a try! Restart your mobile device and Eclipse to be on safe side and check if it works.

Sabina answered 3/3, 2014 at 15:18 Comment(0)
M
1

I had the same issue i have created own API to check whether google play service is installed or not , it works fine for me. Just pass package information of google play service it will give you the value

below is the code:


public static boolean isGooglePlayServicesInstalled() { try { ApplicationInfo info = NativeActivity.CURRENT.getPackageManager().getApplicationInfo("com.google.android.gms", 0 );

LOG.d(LOG_IDENTIFIER, "info : "+ info); return true; } catch(PackageManager.NameNotFoundException e) { e.printStackTrace(); LOG.e(LOG_IDENTIFIER, "NameNotFoundException : "+ e.getMessage()); } return false; }

Maidstone answered 29/6, 2015 at 11:6 Comment(0)
D
0

I had the exact same problem when working with several developers. If I RUN the project from my ADT it works well, but from theirs it isn't..

The answer was to put their SHA-1 key with the package name in Google API console as well as mine. We are three developers, so we needed to put in three SHA-1 keys..

I hope it gives you some inspiration...

Defense answered 29/12, 2013 at 14:0 Comment(0)
M
0

For me deleting the following code fixed it !

mLocationClient.setMockMode(true);
Macnair answered 20/1, 2014 at 18:57 Comment(0)
K
0

In my case it meant, there is some kind of mistake in my implementation, and it says that it cannot find the resource for the error message to be properly shown in LogCat. When I fixed that mistake in my implementation the problem from LogCat was gone as well. So actually unless you are missing some really neccessary resource you should not concentrate to fix the missing resources, but rather fix your implementation.

The mistake, BTW, was that I was running ads in debug mode without going to ads test mode.

Kellykellyann answered 5/3, 2014 at 9:19 Comment(0)
T
0

I believe that this is a bug in the current Google Play Services library, revision 15, as the underlying cause appears to be caused by failing to read a resource file:

W/ResourceType(25122): Requesting resource 0x7f0c000d failed because it is complex
E/GooglePlayServicesUtil(25122): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

It seems that the Google Play Services library attempts to read a resource file and has a generic catch-all that displays this error message when the resource fails to load. This corresponds with what kreker managed to decompile from the library and would explain the log messages.

Tenure answered 6/3, 2014 at 10:8 Comment(0)
C
0

LE: I just remembered this was about using Google Maps, so my answer doesn't really answer the initial question, but I hope some people will save hours/days banging their heads on their desks if they have the same issue with Play Game Services.

I too had this incredibly cryptic error. It wasn't anything related to location services for me, but with not properly reading the documentation, more precisely step 3, where it says to add the following to your AndroidManifest.xml:

<meta-data android:name="com.google.android.gms.games.APP_ID"
    android:value="@string/app_id" />

You should obviously also have the following in AndroidManifest.xml

<meta-data android:name="com.google.android.gms.version"
   android:value="@integer/google_play_services_version"/>

I was using the BaseGameActivity they suggest to use when you want to implement game services so I was a bit surprised it didn't work straight away. I did create a dedicated module for a copy of the google-play-services_lib, I did have the latest version of it (4323000 as of writing) and I did set this as a module dependency to my main module (using Android Studio here). But that little line above fixed everything.

Chalcography answered 2/4, 2014 at 18:51 Comment(0)
S
0

I had the same problem. As Kristopher Johnson said, I referenced google-play-services_lib, but it didn't work. I added google_play_services_lib.jar (look at your SDK/google folder) under project properties/java build path/libraries/android dependencies and error vanished.

Sheepcote answered 4/4, 2014 at 7:18 Comment(0)
C
0

You know, I don't think it's a bug from sdk. "The Google Play services resources were not found. Check your project configuration to ensure that the resources are included" is exactly right. The jar file putted into your /libs doesn't contain any resources like *xml, *png etc. The error logs mean this. And If your ever added support libraries like v4, v7-appcompat, v7-cardview, v7-recyclerview, v7-pallete or v7-gridlayout, sometimes logs which imply that resources are in short occur. All these is because that resources in projects are not imported. So, import support projects as library ASAP. Of course, you first download this support projects through SDK Manager at the item of extras

Christogram answered 20/11, 2014 at 7:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.