-1

Someone please help me, i have project to get current location latitude and longitude. i got the project from androidhive.

when i complie it, i got an error

java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4452000 but found 6587000.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

its my androidmanifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.koenb_fashion_fix"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

<application
    android:name="com.koen_bfashion.image.AppController"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/MyTheme" >
    <meta-data android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >

        <meta-data
            android:name="android.app.default_searchable"
            android:value=".SearchResultsActivity" />

    </activity>
    <activity android:name="SplashScreen">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="LoginLayout"></activity>
    <activity android:name=".SearchResultsActivity" android:parentActivityName="com.koenb_fashion_fix.MainActivity" >
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>

        <meta-data
            android:name="android.app.searchable"
            android:resource="@xml/searchable" />
    </activity>
    <activity android:name="Tampil_Produk_Fragment"></activity>
    <activity android:name="Transfer_Layout"></activity>

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyDG5xQBueWTP8GrXQbaRmnJdVZO73KwRAQ" />
    <activity android:name="MainActivity2"></activity>
</application>

</manifest>

im sure the API KEY is correct, and i have added

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

and the library of the google-play-service-lib is 22 i'm confuse, can someone tell me why i still get that error?

  • look at this link http://stackoverflow.com/questions/19843784/google-play-services-library-update-and-missing-symbol-integer-google-play-serv – Sushant Mar 12 '15 at 04:42

3 Answers3

0

You need to also include the google play services version that your app is referencing. So just add a reference to the integer where this is stored below your API_KEY meta-data.

<meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="AIzaSyDG5xQBueWTP8GrXQbaRmnJdVZO73KwRAQ" />
<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
Andrea Thacker
  • 3,440
  • 1
  • 25
  • 37
0

Just you need is to add the gms version information in manifest :

   <activity>
     <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyDG5xQBueWTP8GrXQbaRmnJdVZO73KwRAQ" />
   <activity android:name="MainActivity2"></activity>

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

If you do not add android:name="com.google.android.gms.version" in meta data then the wrong value is fetched and error comes :

The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4452000 but found 6587000

Kushal
  • 8,100
  • 9
  • 63
  • 82
0

Try passing the values <meta-data android:name="com.google.android.gms.version" android:value="6587000" /> but this may cause error in some api's

Vishnu
  • 1,516
  • 1
  • 10
  • 15
  • We should avoid adding constant value : android:value="6587000" – Kushal Mar 12 '15 at 06:29
  • Yes that is correct, you can try importing the project into your workspace (Dont forget to copy to workspace) and add the the poject as a library in your project. – Vishnu Mar 12 '15 at 09:19
  • You are correct but my point is that instead of : you should use : May be specifying 6587000 as value may solve your error but it is not correct way to do – Kushal Mar 12 '15 at 10:14