Skip to main content

Meta-Data tag updates with MAP API v2

Caused by: java.lang.IllegalStateException: The meta-data tag in
your app's AndroidManifest.xml does not have the right value. Expected
4030500 but found 0. You must have the following declaration within the
element: <meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
If you get this type of error while launch your application which is based on Google Map V2,then update your AndroidMenifest.xml file.

Solution
- Google Play Services have been updated to 4.0.30 very recently and so you seem to be using that version of google-play-services_lib. Assumption based on this line:

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


Not all devices have received an update of GooglePlayServices.APK, which needs to be at least the   same version as a client library you are using.
Check version of GPServices.APK in Settings app. For me it is still at 3.2.66 and last time I had to wait few days for the update.
If you are using gradle, you can put lower version dependency. If not, you have to download older version of google-play-services_lib from somewhere.

For more details refer this google document. It's a new requirement added from the last revision 13 update to google-play-services.

Note:
After Adding this tag, if you get this error like:
No resources found that match the given name (at 'value' with value '@integer/ google_play_services_version').

Solution
- It is probably that your library is not linked to project properly or that you have older google-play-services library version so conflict appears and Eclipse got stupid..  :)
You don't need to add anything in integers.xml. When you link properly Google-play-services library to your project reference b will be found and you are ready to go. When you add library to your project just do one more clean so funny Eclipse environment sweep-out things properly.
If you hardcode somewhere this number when next play version come you would need to update it. And if you forget that, you will spend time again looking for bug..  :)

Comments

Popular posts from this blog

Fragment: App loads with white screen for 3 secs before showing proper UI

Issue: 1) When my application start then white/black screen appears, and then main UI is display.  2) Before my fragment load in activity black/white screen appears for 3/4 seconds and then fragment load. Solution: To fix this nasty problem, update the /res/values/styles.xml to include <item name="android:windowDisablePreview">true</item> or <item name="android:windowBackground">@android:color/black</item> for example : <!-- Application theme. -->  <style name="AppTheme" parent="AppBaseTheme">  <!-- All customizations that are NOT specific to a particular API-level can go here. -->  <item name="android:windowDisablePreview">true</item>  <!-- <item name="android:windowBackground">@android:color/black</item> -->  </style>

Android: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

Solution Try the following any one solution and problem will go away: 1)  Apply following steps: Close the project and reopen it. Clean the project (It will rebuild the buildpath hence reconfiguring with the JDK libraries) OR Delete and Re-import the project and if necessary do the above steps again. 2)  Apply following steps: Go to properties of project with the build error (right click > Properties) View the "Libraries" tab in the "Build Path" section Find the "JRE System Library" in the list (if this is missing then this error message is not an eclipse bug but a mis-configured project) Remove the "JRE System Library" Hit "Add Library ...", Select "JRE System Library" and add the appropriate JRE for the project (eg. 'Workspace default JRE') Hit "Finish" in the library selection and "OK" in the project properties and then wait for the re-build of the project Hopefully th

Error: Retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23

My project is going on easily but suddenly what I found below bugs when developing an app. I know it's minor bug but it may be useful to anyone. Here is the error: Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. Solution: This happens because after updates your android studio uses API 23 by default. 1) First check that your compile SDK version must match the support library's major version. If you are using version 23 of the support library, you need to compile against version 23 of the Android SDK. Alternatively you can continue compiling against version 22 of the Android SDK by switching to the latest support library v22.   2) Go to your project structure -> Properties -> and change Build tool version to