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"?
Project > Clean
). I've noticed that this sometimes fixes R.java/resource issues.
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...)
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.
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.
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...
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
https://i.stack.imgur.com/JDv0L.jpg
For more detailed walkthroughs:
How to get GoogleMaps running on emulator
I had this issue too. The way I solved it was the following:
Delete the google-play-services_lib library-project. Remove the (now invalid) google-play-services_lib reference in [your project] > Properties > Android. 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. 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!
I am encounted this problem when I am using Admob JUST because I forgot to write my Ad Unit ID into @string
.
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.
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.
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!
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:
Update Android SDK so the latest Play Service is installed. Go to the android-sdk-root/extras/google/google_play_services/libproject directory. 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!). Open IntelliJ IDEA project properties and add new Module google-play-services_lib. Check if it's marked as a Library. Add google-play-services_lib library project as a dependency to the main project. 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.
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?
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.
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.
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:
LOG.d(LOG_IDENTIFIER, "info : "+ info);
return true;
}
catch(PackageManager.NameNotFoundException e)
{
e.printStackTrace();
LOG.e(LOG_IDENTIFIER, "NameNotFoundException : "+ e.getMessage());
}
return false;
}
For me deleting the following code fixed it !
mLocationClient.setMockMode(true);
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.
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.
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...
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.
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.
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
Success story sharing