Android Question Problem with B4A New Install and GoogleMaps

Paul Leischow

Member
Licensed User
Longtime User
What has changed from when the GoogleMaps tutorial was made and B4A 7.80 ??
I did a new install of B4A version 7.80 following the install instructions from here...
https://www.b4x.com/b4a.html

I can compile and run code without problems.

Then I follow the tutorial for GoogleMaps here...
https://www.b4x.com/android/forum/threads/google-maps.63930/#post-404386

But when I try to run the code I get lots of errors...
java.lang.RuntimeException: java.lang.SecurityException: my location requires permission ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION
at anywheresoftware.b4a.objects.MapFragmentWrapper$1.onMapReady(MapFragmentWrapper.java:196)
at com.google.android.gms.maps.zzab.zza(Unknown Source)
at com.google.android.gms.maps.internal.zzaq.onTransact(Unknown Source)
at android.os.Binder.transact(Binder.java:507)
at er.b:)com.google.android.gms.DynamiteModulesB@11975448:20)
at com.google.android.gms.maps.internal.bf.a:)com.google.android.gms.DynamiteModulesB@11975448:5)
at com.google.maps.api.android.lib6.impl.bc.run:)com.google.android.gms.DynamiteModulesB@11975448:5)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: java.lang.SecurityException: my location requires permission ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION
at com.google.maps.api.android.lib6.impl.ba.c:)com.google.android.gms.DynamiteModulesB@11975448:684)
at com.google.android.gms.maps.internal.k.onTransact:)com.google.android.gms.DynamiteModulesB@11975448:141)
at android.os.Binder.transact(Binder.java:507)
at com.google.android.gms.internal.zzeu.zzb(Unknown Source)
at com.google.android.gms.maps.internal.zzg.setMyLocationEnabled(Unknown Source)
at com.google.android.gms.maps.GoogleMap.setMyLocationEnabled(Unknown Source)
at anywheresoftware.b4a.objects.MapFragmentWrapper$1.onMapReady(MapFragmentWrapper.java:183)
... 13 more

What am I missing or doing wrong??
I am using latest B4A version, latest Android SDK with suggested libraries, latest Java 1.8.0_162
 

DonManfred

Expert
Licensed User
Longtime User
1. Set My Location Enabled to false in the Designer.
2. Check the Runtimepermissions Tutorial.

In permission result event you then can set the mylocation enabled to true.
 
Upvote 0

Paul Leischow

Member
Licensed User
Longtime User
Thank you Don, that worked perfectly.

Erel, please add this info to the Google Maps tutorial. If this info were part of the tutorial, it would have saved me hours of trying to find the answer in the Forum and coming up blank. I'm sure others will also run into this and having all the needed information posted together would be very helpful.
 
Upvote 0
Top