Android Question Missing Android declaration in the manifest file

microbox

Active Member
Licensed User
Longtime User
I am following the tutorials on google maps android v2, initially got the first demo running. Now I'm using warwound's great library (GoogleMapsExtras v2) and was able to get the ComplexPolygonDemo working. But I'm stuck getting the OnMarkerDragListenerDemo running I have the following error
B4X:
Logger connected to:  asus ASUS_Z00LD
--------- beginning of main
** Activity (main) Create, isFirst = true **
Error occurred on line: 31 (Main)
java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  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" />
    at com.google.android.gms.common.zzg.zzaH(Unknown Source)
    at com.google.android.gms.common.zzg.isGooglePlayServicesAvailable(Unknown Source)
    at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
    at com.google.android.gms.common.GoogleApiAvailability.isGooglePlayServicesAvailable(Unknown Source)
    at anywheresoftware.b4a.objects.MapFragmentWrapper.IsGooglePlayServicesAvailable(MapFragmentWrapper.java:92)
    at wt.gomap.main._activity_create(main.java:379)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at wt.gomap.main.afterFirstLayout(main.java:102)
    at wt.gomap.main.access$000(main.java:17)
    at wt.gomap.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5289)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
** Activity (main) Resume **
Hope anybody can tell me what I'm doing wrong.

Best regards,
Joe
 

DonManfred

Expert
Licensed User
Longtime User
you did not added the google play base snippet?

B4X:
'************ Google Play Services Base ************
AddApplicationText(
   <activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"
  android:exported="false"/>
    <meta-data
  android:name="com.google.android.gms.version"
  android:value="@integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************
 
Upvote 0

microbox

Active Member
Licensed User
Longtime User
Hi DonManfred, thanks for giving the time. Here is what I have on my Manifest file..
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")

AddApplicationText(
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"
  android:exported="false"/>
<meta-data
  android:name="com.google.android.maps.v2.API_KEY"
  android:value="AIzaSyA8SZ-thqrHli_M2PR0qpPTnly2AFOXXXX"/>
   <meta-data android:name="com.google.android.gms.version"
   android:value="@integer/google_play_services_version" />
)
But now gives me this...
B4X:
Logger connected to:  asus ASUS_Z00LD
--------- beginning of system
--------- beginning of main
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object anywheresoftware.b4a.objects.collections.Map.Get(java.lang.Object)' on a null object reference
    at anywheresoftware.b4a.objects.MapFragmentWrapper$1.onMapReady(MapFragmentWrapper.java:196)
    at com.google.android.gms.maps.MapFragment$zza$1.zza(Unknown Source)
    at com.google.android.gms.maps.internal.zzt$zza.onTransact(Unknown Source)
    at android.os.Binder.transact(Binder.java:380)
    at com.google.android.gms.maps.internal.bw.a(:com.google.android.gms.DynamiteModulesB:82)
    at com.google.maps.api.android.lib6.impl.bf.run(:com.google.android.gms.DynamiteModulesB:1805)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5289)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object anywheresoftware.b4a.objects.collections.Map.Get(java.lang.Object)' on a null object reference
    at anywheresoftware.b4a.objects.MapFragmentWrapper$1.onMapReady(MapFragmentWrapper.java:181)
    ... 13 more
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object anywheresoftware.b4a.objects.collections.Map.Get(java.lang.Object)' on a null object reference
    at anywheresoftware.b4a.objects.MapFragmentWrapper$1.onMapReady(MapFragmentWrapper.java:196)
    at com.google.android.gms.maps.MapFragment$zza$1.zza(Unknown Source)
    at com.google.android.gms.maps.internal.zzt$zza.onTransact(Unknown Source)
    at android.os.Binder.transact(Binder.java:380)
    at com.google.android.gms.maps.internal.bw.a(:com.google.android.gms.DynamiteModulesB:82)
    at com.google.maps.api.android.lib6.impl.bf.run(:com.google.android.gms.DynamiteModulesB:1805)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5289)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object anywheresoftware.b4a.objects.collections.Map.Get(java.lang.Object)' on a null object reference
    at anywheresoftware.b4a.objects.MapFragmentWrapper$1.onMapReady(MapFragmentWrapper.java:181)
    ... 13 more
 
Last edited:
Upvote 0

microbox

Active Member
Licensed User
Longtime User
Hi Erel, I managed to make the GoogleMapDemo running...but now I want to see how OnMarkerDragListenerdemo work :)
 
Upvote 0
Top