I have recently removed from my app the dangerous "phone" permission and everything works fine on tenths of devices.
I have suddenly this crash on a Android 5.0 device
It is generated in this sub:
TargetSdk is 28 and you see in the picture the permission listed in B4A
Why this sub requires READ_PHONE_STATE and why it happens only on this particular device ?
The user experience the crash only when 3G/4G data is enabled. If they are switched off and it works only with Wi-Fi the app runs ok.
I have suddenly this crash on a Android 5.0 device
B4X:
java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10190 nor current process has android.permission.READ_PHONE_STATE
It is generated in this sub:
B4X:
Sub CheckConnection As Boolean
Dim ph As Phone
Dim myLAN As ServerSocket
myLAN.Initialize(0, "")
If ph.GetDataState <> "CONNECTED" And myLAN.GetMyIP = "127.0.0.1" Then --->> ERROR HERE
Return False
Else
Return True
End If
End Sub
TargetSdk is 28 and you see in the picture the permission listed in B4A
Why this sub requires READ_PHONE_STATE and why it happens only on this particular device ?
The user experience the crash only when 3G/4G data is enabled. If they are switched off and it works only with Wi-Fi the app runs ok.