Android Question App Crashing (Solved)

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hi All,

A problem.
Existing App updated for Runtime Permissions.

Install App OK.
Attempt to open App and it crashes, it does not report line numbers etc.
This occurs in release and debug modes. Also the same result if a fresh install or installing over existing [working] App.

The App installs OK a Galaxy Note 3 [Android 5] and a LG V20 [Android 8].
The problem occurs on a Galaxy Tab A [Android 9].
I suspect a timing issue due to the Tab A running faster but I really have no idea.

I am working my way through using Log() to narrow down where exactly it is crashing.
Can someone please tell what the crash info from the Log means. Crash info and code below.

I know this isn't much to go on but if someone can translate the LOG to SIMPLE i would appreciate it.

Regards Roger


B4X:
Sub Activity_PermissionResult (Permission As String, Result As Boolean)

End Sub

Sub mFragment_Ready
Log(" Start of mFragment_Ready") 
    gmap = mFragment.GetMap
Log("gmap")
   
'   '*****Added as part of Map upgrade 10 Aug 19                  
    rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)  

'**** Requests permission but crashes before user responds
  
    gmap.MyLocationEnabled = Result


   
   If gmap.IsInitialized = False Then
        ToastMessageShow("Error initializing map.", True)
   Else
       ' Do stuff
   Then
       ' More stuff
  
Log(" End of mFragment_Ready Sub")
  
End Sub


 

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hi Erel,

Manifest below.

" android:value="AIzaSyAn4mAf8Nqha2H5oHHYvbCx9Ge37??????"/>)" is dummy for this reply only


Regards Roger
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
i dont see any addpermission?

also i´m missing

B4X:
AddApplicationText(
<uses-library
      android:name="org.apache.http.legacy"
      android:required="false" />
)

The last is the source of your problem

Go again over the googlemap tutorial and also go again over the runtimepermissions tutorial.
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
Thankyou DonManfred,

Once again you've come to the rescue. The "AddApplicationText" code was indeed the problem, I'm surprised that the App was working on the earlier devices without it, but that's computers for you.
Reading back over the Maps Tutorial, the "AddApplicationText" hits you in the face when you know what you are looking for. That of course is where you have the advantage, you know what you are talking about. I could have read that 6 times with out the penny dropping.

You wrote that you did not see any "addpermission".
The manifest has the line:
"AddPermission(android.permission.ACCESS_NETWORK_STATE)",
was there a different addpermission that I have missed?

Thanks again
Regards Roger
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…