Pergunta

Anybody here, who knows, why this not works?:

Manifest:

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

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

implement in my xml:

<fragment
    android:id="@+id/map"
    android:name="com.google.android.gms.maps.SupportMapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

I'm getting this error:

Caused by: java.lang.IllegalStateException: The meta-data tag in your app's     
AndroidManifest.xml does not have the right value.  Expected 4323000 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" />

I have the meta-data in my manifest, but i'm getting the error. Why?

Thanks a lot :)

Foi útil?

Solução

Add this in your manifest file-

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

Outras dicas

Your logcat itself clearly saying that:

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" />
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top