Android Question Problem with GMaps and Manifest file

clooney48

Active Member
Licensed User
Longtime User
Hi!

I tried to integrate Google Maps according the "Google Maps Android v2 tutorial". When I run now the example script, the code stops at the line:
B4X:
If mFragment.IsGooglePlayServicesAvailable = False Then
.....
with this message:
B4X:
If mFragment.IsGooglePlayServicesAvailable = False Then
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 <application> element:   
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

My manifest.xlm looks like this, there is no <application> element:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)

AddManifestText( <permission
          android:name="$PACKAGE$.permission.MAPS_RECEIVE"
          android:protectionLevel="signature"/>
      <uses-feature android:glEsVersion="0x00020000" android:required="true"/>)
     
AddApplicationText(<meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="AIzXCSyCoV0b80YaSX9GbBVzJocBTJbJXElnfHpw"/>)
What´s wrong with the manifest.file?
 

juliotorres

New Member
Licensed User
Longtime User
hi

I have the same problem...

error message:

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 <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />


manifest file:


AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.MAPS_RECEIVE"/>
<uses-permission android:protectionLevel="signature"/>
<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"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>)

AddApplicationText(
<meta-data
android:name="android.maps.v2.API_KEY"
android:value="AIzaSyAA5upVHDKVZP1m8JY8RteJ1Y1WSe36vNE"/>)

SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")

'End of default text.

[/CODE]
 

Attachments

  • Screenshot_2013-11-04-16-09-00.png
    Screenshot_2013-11-04-16-09-00.png
    144.4 KB · Views: 180
Upvote 0
Top