Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value

Estou com o seguinte erro:

10-17 18:34:37.488: E/AndroidRuntime(15606): java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.caelum.listadealunos/br.com.caelum.activity.MostraAlunosProximosActivity}: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 6111000 but found 0.  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" />

Alguém pode me ajudar já fiz de tudo pesquisei dias na web nada funciona :/

2 respostas

Meu manifest:

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

    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.RECEIVE_SMS"/>
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.WRITE_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <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="android.permission.ACCESS_FINE_LOCATION"/>

    <uses-feature android:glEsVersion="0x00020000"
                  android:required="true"/>

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

    <meta-data
            android:name="com.google.android.maps.V2.API_KEY"
            android:value="AIzaSyBGuoMf1KcHgbIvucV-AVmPKA9fIGKCmTs"/>


    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <uses-library android:name="com.google.android.maps" />

        <activity
            android:name="br.com.caelum.activity.ListaAlunosActivity"
            android:label="@string/app_name"
            android:theme="@style/Theme.AppCompat.Light.DarkActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="br.com.caelum.activity.FormularioActivity"
            android:label="@string/title_activity_formulario" >
        </activity>
        <activity
            android:name="br.com.caelum.activity.ProvasActivity"
            android:label="@string/provas" >
        </activity>
        <activity
            android:name="br.com.caelum.activity.MostraAlunosProximosActivity"
            android:label="@string/mapa" >
        </activity>

        <receiver android:name="br.com.caelum.receiver.SMSReceiver" android:enabled="true">
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED"/>
            </intent-filter>
        </receiver>

    </application>


</manifest>
solução!

Oi Augusto,

vamos olhar o erro que apareceu:

The meta-data tag in your app's AndroidManifest.xml does not have the right value.  
Expected 6111000 but found 0.  
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" />

Veja que no próprio erro há a resposta para corrigi-lo:

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

Olhando seu AndroidManifest, você esqueceu de colocar esse meta-data dentro da tag application, você os colocou dentro da tag manifest, mas fora da application.

Isso deve resolver seu problema:

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

    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.RECEIVE_SMS"/>
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.WRITE_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <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="android.permission.ACCESS_FINE_LOCATION"/>

    <uses-feature android:glEsVersion="0x00020000"
                  android:required="true"/>

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <uses-library android:name="com.google.android.maps" />

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

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"                
            android:value="AIzaSyBGuoMf1KcHgbIvucV-AVmPKA9fIGKCmTs"/>

        <activity
            android:name="br.com.caelum.activity.ListaAlunosActivity"
            android:label="@string/app_name"
            android:theme="@style/Theme.AppCompat.Light.DarkActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="br.com.caelum.activity.FormularioActivity"
            android:label="@string/title_activity_formulario" >
        </activity>
        <activity
            android:name="br.com.caelum.activity.ProvasActivity"
            android:label="@string/provas" >
        </activity>
        <activity
            android:name="br.com.caelum.activity.MostraAlunosProximosActivity"
            android:label="@string/mapa" >
        </activity>

        <receiver android:name="br.com.caelum.receiver.SMSReceiver" android:enabled="true">
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED"/>
            </intent-filter>
        </receiver>

    </application>


</manifest>