Problem with Geolocation
Hello,
My app was working correctly and for a few days it crashes as soon as I call NEW_POSITION. Here part of the code as well as the error message obtained in debug mode. On the smartphone the location authorization is OK and network is OK. I restart the smartphone and still the same crash, even though it was working a few days ago.
An idea ?
Hello,
My app was working correctly and for a few days it crashes as soon as I call NEW_POSITION. Here part of the code as well as the error message obtained in debug mode. On the smartphone the location authorization is OK and network is OK. I restart the smartphone and still the same crash, even though it was working a few days ago.
An idea ?
B4X:
Sub NEW_POSITION 'Geolocalise
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
wait for Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
GeoLoc.Initialize("GeoLocation")
GeoLoc.GetLocation
GeoLoc.geoAddress '(Ligne 63)
MyLatitude = GeoLoc.Lattitude
MyLongitude = GeoLoc.Longitude
Log(GeoLoc.Address)
'Affiche
LblLat.Text = "Lat: " & MyLatitude
LblLong.Text = "Long: " & MyLongitude
LblAdresse.Text = GeoLoc.Address
Else
Activity.Finish
StartActivity(Main) 'show the main activity again
ToastMessageShow("Position non trouvée, Problème de réseau ou GPS", True)
End If
End Sub
Copying updated assets files (40)
*** Service (starter) Create ***
Using FileProvider? true
** Service (starter) Start **
** Activity (main) Create (first time) **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (sourds) Create (first time) **
** Activity (sourds) Resume **
Error occurred on line: 63 (Sourds)
java.io.IOException: frip: DEADLINE_EXCEEDED: deadline exceeded after 4.932716094s. Name resolution delay 0.050917656 seconds. [closed=[], open=[[buffered_nanos=4933385727, waiting_for_connection]]]
at android.location.Geocoder$SynchronousGeocoder.getResults(Geocoder.java:388)
at android.location.Geocoder.getFromLocation(Geocoder.java:134)
at de.donmanfred.GeoLocatorwrapper.geoAddress(GeoLocatorwrapper.java:112)
at b4a.example.sourds$ResumableSub_NEW_POSITION.resume(sourds.java:570)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:150)
at anywheresoftware.b4a.BA$2.run(BA.java:395)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8913)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)