Android Question problem with gps example: current location not marked

toby

Well-Known Member
Licensed User
Longtime User
I started with the tutorial example: Google map with FusedLocationProvider

After setting google map api key, I ran it as it is. My current location wouldn't be shown and marked until I manually press the gps location icon. There are at least 3 errors in the logs which might or might not be related.

Could someone give me some hints, please?

Logs:
Logger connected to: asus ASUS_Z00AD
--------- beginning of main
[15907] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
SetAppTypeFace- try to flip, app = b4a.example3
Typeface getFontPathFlipFont - systemFont = default#default
SetAppTypeFace- try to flip, app = b4a.example3
Typeface getFontPathFlipFont - systemFont = default#default
Starting remote logger. Port: 29707
Render dirty regions requested: true
Validating map...
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
*** Debugger waiting for connection (0) ***
After accept
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Making Creator dynamically
--------- beginning of system
Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@data@com.google.android.gms@app_chimera@m@0000006a@DynamiteModulesB_GmsCore_prodlmp_alldpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006a/DynamiteModulesB_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
Google Play services client version: 11020000
Google Play services package version: 12673013
Failed to ensure directory: /storage/MicroSD/Android/data/b4a.example3/cache
Skipped 38 frames! The application may be doing too much work on its main thread.
FLP connected
Ready!!!
Location Changed: (Location) Location[fused 42.946857,-81.238760 acc=15 et=+4h6m2s930ms alt=246.60000610351563 {Bundle[mParcelledData.dataSize=52]}]
Local module descriptor class for com.google.android.gms.googlecertificates not found.
Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
Selected remote version of com.google.android.gms.googlecertificates, version >= 4
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@data@com.google.android.gms@app_chimera@m@0000006d@GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006d/GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
Location Changed: (Location) Location[fused 42.946874,-81.238760 acc=14 et=+4h10m58s392ms alt=246.60000610351563 {Bundle[mParcelledData.dataSize=52]}]
Location Changed: (Location) Location[fused 42.946874,-81.238760 acc=12 et=+4h11m3s20ms alt=246.60000610351563 {Bundle[mParcelledData.dataSize=52]}]
Location Changed: (Location) Location[fused 42.946864,-81.238768 acc=15 et=+4h11m17s851ms alt=246.60000610351563 {Bundle[mParcelledData.dataSize=52]}]
Location Changed: (Location) Location[fused 42.946866,-81.238764 acc=12 et=+4h11m22s866ms alt=246.60000610351563 {Bundle[mParcelledData.dataSize=52]}]
Location Changed: (Location) Location[fused 42.946852,-81.238787 acc=14 et=+4h11m37s915ms alt=246.60000610351563 {Bundle[mParcelledData.dataSize=52]}]
** Activity (main) Pause, UserClosed = false **
[16361] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
SetAppTypeFace- try to flip, app = b4a.example3
Typeface getFontPathFlipFont - systemFont = default#default
SetAppTypeFace- try to flip, app = b4a.example3
Typeface getFontPathFlipFont - systemFont = default#default
Starting remote logger. Port: 29707
Render dirty regions requested: true
Validating map...
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
*** Debugger waiting for connection (0) ***
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Making Creator dynamically
Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@data@com.google.android.gms@app_chimera@m@0000006a@DynamiteModulesB_GmsCore_prodlmp_alldpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006a/DynamiteModulesB_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
Google Play services client version: 11020000
Google Play services package version: 12673013
Failed to ensure directory: /storage/MicroSD/Android/data/b4a.example3/cache
After accept
FLP connected
Ready!!!
Background sticky concurrent mark sweep GC freed 40599(3MB) AllocSpace objects, 18(932KB) LOS objects, 8% free, 22MB/25MB, paused 2.913ms total 113.557ms
Location Changed: (Location) Location[fused 42.946842,-81.238789 acc=15 et=+4h12m22s551ms alt=246.60000610351563 {Bundle[mParcelledData.dataSize=52]}]
Background partial concurrent mark sweep GC freed 13578(741KB) AllocSpace objects, 22(5MB) LOS objects, 35% free, 29MB/45MB, paused 2.408ms total 122.305ms
Local module descriptor class for com.google.android.gms.googlecertificates not found.
Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
Selected remote version of com.google.android.gms.googlecertificates, version >= 4
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@data@com.google.android.gms@app_chimera@m@0000006d@GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006d/GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
Location Changed: (Location) Location[fused 42.946849,-81.238785 acc=14 et=+4h12m42s594ms alt=246.60000610351563 {Bundle[mParcelledData.dataSize=52]}]
 
Last edited:

toby

Well-Known Member
Licensed User
Longtime User
@Erel. Because I want to detect and show the phone's current location on the map, so I need Fused Location Provider.
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
@Erel, That's exactly what I did by starting with your example.

With tips from @DonManfred in another thread, I've came out with the following solution:
1. sub CenterizeMap() is added to Main activity:

B4X:
public Sub CenterizeMap
    If lastLocation.IsInitialized Then
        gmap.AddMarker(lastLocation.Latitude,lastLocation.Longitude, "test")
        Dim cp As CameraPosition
        cp.Initialize (lastLocation.Latitude, lastLocation.Longitude, 15)
        gmap.AnimateCamera(cp)
    End If
 
End Sub

2. In the location changed event, save the location info and call the above sub.
 
Last edited:
Upvote 0
Top