H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 26, 2023 #1 Hi, I got this error when using local hotspot example: B4X: UID 10392 does not have Coarse/Fine Location permission 'the number 10392 is changed every run to another number 'I granted fine location without success error thrown on android 9 and android 12 devices.
Hi, I got this error when using local hotspot example: B4X: UID 10392 does not have Coarse/Fine Location permission 'the number 10392 is changed every run to another number 'I granted fine location without success error thrown on android 9 and android 12 devices.
Erel B4X founder Staff member Licensed User Longtime User Jun 27, 2023 #2 Can you post the full stack trace from the logs? Have you made any changes to the example? The location permission is requested and checked. Upvote 0
Can you post the full stack trace from the logs? Have you made any changes to the example? The location permission is requested and checked.
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 27, 2023 #3 Erel said: Have you made any changes to the example? Click to expand... No Erel said: The location permission is requested and checked Click to expand... Yes Erel said: Can you post the full stack trace from the logs? Click to expand... Tested on 3 devices: I see error on android 9 and 11 is the same: location mode is not enabled, but location permission is granted! And in Android 12 the error as above. In B4A IDE, I don't see dangerous location permission listed in permission list in log tab. why!!! Android 9 ** Service (starter) Destroy (ignored)** *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create (first time) ** Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events. ** Activity (main) Resume ** b4xmainpage$ResumableSub_StartHotspotresume (java line: 289) java.lang.SecurityException: Location mode is not enabled. at android.os.Parcel.createException(Parcel.java:1966) at android.os.Parcel.readException(Parcel.java:1934) at android.os.Parcel.readException(Parcel.java:1884) at android.net.wifi.IWifiManager$Stub$Proxy.startLocalOnlyHotspot(IWifiManager.java:2162) at android.net.wifi.WifiManager.startLocalOnlyHotspot(WifiManager.java:2539) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132) at b4a.example.b4xmainpage$ResumableSub_StartHotspot.resume(b4xmainpage.java:289) at b4a.example.b4xmainpage._vvvv5(b4xmainpage.java:267) at b4a.example.b4xmainpage$ResumableSub_btnStart_Click.resume(b4xmainpage.java:106) at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:215) at anywheresoftware.b4a.BA.raiseEvent(BA.java:201) at anywheresoftware.b4a.keywords.Common$15.run(Common.java:1804) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:6990) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.wifi.WifiServiceImpl.startLocalOnlyHotspot(WifiServiceImpl.java:2532) at android.net.wifi.IWifiManager$Stub.onTransact(IWifiManager.java:563) at android.os.Binder.execTransact(Binder.java:739) Android 11 Logger connected to: R58N103P25D --------- beginning of system --------- beginning of main *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create (first time) ** Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events. ** Activity (main) Resume ** ** Activity (main) Pause event (activity is not paused). ** ** Activity (main) Resume ** b4xmainpage$ResumableSub_StartHotspotresume (java line: 289) java.lang.SecurityException: Location mode is not enabled. at android.os.Parcel.createExceptionOrNull(Parcel.java:2386) at android.os.Parcel.createException(Parcel.java:2370) at android.os.Parcel.readException(Parcel.java:2353) at android.os.Parcel.readException(Parcel.java:2295) at android.net.wifi.IWifiManager$Stub$Proxy.startLocalOnlyHotspot(IWifiManager.java:3217) at android.net.wifi.WifiManager.startLocalOnlyHotspotInternal(WifiManager.java:3402) at android.net.wifi.WifiManager.startLocalOnlyHotspot(WifiManager.java:3349) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132) at b4a.example.b4xmainpage$ResumableSub_StartHotspot.resume(b4xmainpage.java:289) at b4a.example.b4xmainpage._vvvv5(b4xmainpage.java:267) at b4a.example.b4xmainpage$ResumableSub_btnStart_Click.resume(b4xmainpage.java:106) at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:215) at anywheresoftware.b4a.BA.raiseEvent(BA.java:201) at anywheresoftware.b4a.keywords.Common$15.run(Common.java:1804) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8550) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.wifi.WifiServiceImpl.startLocalOnlyHotspot(WifiServiceImpl.java:1808) at android.net.wifi.IWifiManager$Stub.onTransact(IWifiManager.java:1138) at android.os.Binder.execTransactInternal(Binder.java:1190) at android.os.Binder.execTransact(Binder.java:1159) --------- beginning of crash Android 12 ** Activity (main) Pause event (activity is not paused). ** ** Activity (main) Resume ** b4xmainpage$ResumableSub_StartHotspotresume (java line: 289) java.lang.SecurityException: UID 10419 does not have Coarse/Fine Location permission at android.os.Parcel.createExceptionOrNull(Parcel.java:2437) at android.os.Parcel.createException(Parcel.java:2421) at android.os.Parcel.readException(Parcel.java:2404) at android.os.Parcel.readException(Parcel.java:2346) at android.net.wifi.IWifiManager$Stub$Proxy.startLocalOnlyHotspot(IWifiManager.java:3546) at android.net.wifi.WifiManager.startLocalOnlyHotspotInternal(WifiManager.java:4303) at android.net.wifi.WifiManager.startLocalOnlyHotspot(WifiManager.java:4250) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132) at b4a.example.b4xmainpage$ResumableSub_StartHotspot.resume(b4xmainpage.java:289) at b4a.example.b4xmainpage._vvvv5(b4xmainpage.java:267) at b4a.example.b4xmainpage$ResumableSub_btnStart_Click.resume(b4xmainpage.java:106) at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:215) at anywheresoftware.b4a.BA.raiseEvent(BA.java:201) at anywheresoftware.b4a.keywords.Common$15.run(Common.java:1804) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.wifi.util.WifiPermissionsUtil.enforceLocationPermission(WifiPermissionsUtil.java:97) at com.android.server.wifi.WifiServiceImpl.enforceLocationPermission(WifiServiceImpl.java:874) at com.android.server.wifi.WifiServiceImpl.startLocalOnlyHotspot(WifiServiceImpl.java:2084) at android.net.wifi.IWifiManager$Stub.onTransact(IWifiManager.java:1236) at android.os.Binder.execTransactInternal(Binder.java:1215) Upvote 0
Erel said: Have you made any changes to the example? Click to expand... No Erel said: The location permission is requested and checked Click to expand... Yes Erel said: Can you post the full stack trace from the logs? Click to expand... Tested on 3 devices: I see error on android 9 and 11 is the same: location mode is not enabled, but location permission is granted! And in Android 12 the error as above. In B4A IDE, I don't see dangerous location permission listed in permission list in log tab. why!!! Android 9 ** Service (starter) Destroy (ignored)** *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create (first time) ** Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events. ** Activity (main) Resume ** b4xmainpage$ResumableSub_StartHotspotresume (java line: 289) java.lang.SecurityException: Location mode is not enabled. at android.os.Parcel.createException(Parcel.java:1966) at android.os.Parcel.readException(Parcel.java:1934) at android.os.Parcel.readException(Parcel.java:1884) at android.net.wifi.IWifiManager$Stub$Proxy.startLocalOnlyHotspot(IWifiManager.java:2162) at android.net.wifi.WifiManager.startLocalOnlyHotspot(WifiManager.java:2539) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132) at b4a.example.b4xmainpage$ResumableSub_StartHotspot.resume(b4xmainpage.java:289) at b4a.example.b4xmainpage._vvvv5(b4xmainpage.java:267) at b4a.example.b4xmainpage$ResumableSub_btnStart_Click.resume(b4xmainpage.java:106) at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:215) at anywheresoftware.b4a.BA.raiseEvent(BA.java:201) at anywheresoftware.b4a.keywords.Common$15.run(Common.java:1804) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:6990) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.wifi.WifiServiceImpl.startLocalOnlyHotspot(WifiServiceImpl.java:2532) at android.net.wifi.IWifiManager$Stub.onTransact(IWifiManager.java:563) at android.os.Binder.execTransact(Binder.java:739) Android 11 Logger connected to: R58N103P25D --------- beginning of system --------- beginning of main *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create (first time) ** Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events. ** Activity (main) Resume ** ** Activity (main) Pause event (activity is not paused). ** ** Activity (main) Resume ** b4xmainpage$ResumableSub_StartHotspotresume (java line: 289) java.lang.SecurityException: Location mode is not enabled. at android.os.Parcel.createExceptionOrNull(Parcel.java:2386) at android.os.Parcel.createException(Parcel.java:2370) at android.os.Parcel.readException(Parcel.java:2353) at android.os.Parcel.readException(Parcel.java:2295) at android.net.wifi.IWifiManager$Stub$Proxy.startLocalOnlyHotspot(IWifiManager.java:3217) at android.net.wifi.WifiManager.startLocalOnlyHotspotInternal(WifiManager.java:3402) at android.net.wifi.WifiManager.startLocalOnlyHotspot(WifiManager.java:3349) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132) at b4a.example.b4xmainpage$ResumableSub_StartHotspot.resume(b4xmainpage.java:289) at b4a.example.b4xmainpage._vvvv5(b4xmainpage.java:267) at b4a.example.b4xmainpage$ResumableSub_btnStart_Click.resume(b4xmainpage.java:106) at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:215) at anywheresoftware.b4a.BA.raiseEvent(BA.java:201) at anywheresoftware.b4a.keywords.Common$15.run(Common.java:1804) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8550) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.wifi.WifiServiceImpl.startLocalOnlyHotspot(WifiServiceImpl.java:1808) at android.net.wifi.IWifiManager$Stub.onTransact(IWifiManager.java:1138) at android.os.Binder.execTransactInternal(Binder.java:1190) at android.os.Binder.execTransact(Binder.java:1159) --------- beginning of crash Android 12 ** Activity (main) Pause event (activity is not paused). ** ** Activity (main) Resume ** b4xmainpage$ResumableSub_StartHotspotresume (java line: 289) java.lang.SecurityException: UID 10419 does not have Coarse/Fine Location permission at android.os.Parcel.createExceptionOrNull(Parcel.java:2437) at android.os.Parcel.createException(Parcel.java:2421) at android.os.Parcel.readException(Parcel.java:2404) at android.os.Parcel.readException(Parcel.java:2346) at android.net.wifi.IWifiManager$Stub$Proxy.startLocalOnlyHotspot(IWifiManager.java:3546) at android.net.wifi.WifiManager.startLocalOnlyHotspotInternal(WifiManager.java:4303) at android.net.wifi.WifiManager.startLocalOnlyHotspot(WifiManager.java:4250) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132) at b4a.example.b4xmainpage$ResumableSub_StartHotspot.resume(b4xmainpage.java:289) at b4a.example.b4xmainpage._vvvv5(b4xmainpage.java:267) at b4a.example.b4xmainpage$ResumableSub_btnStart_Click.resume(b4xmainpage.java:106) at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:215) at anywheresoftware.b4a.BA.raiseEvent(BA.java:201) at anywheresoftware.b4a.keywords.Common$15.run(Common.java:1804) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.wifi.util.WifiPermissionsUtil.enforceLocationPermission(WifiPermissionsUtil.java:97) at com.android.server.wifi.WifiServiceImpl.enforceLocationPermission(WifiServiceImpl.java:874) at com.android.server.wifi.WifiServiceImpl.startLocalOnlyHotspot(WifiServiceImpl.java:2084) at android.net.wifi.IWifiManager$Stub.onTransact(IWifiManager.java:1236) at android.os.Binder.execTransactInternal(Binder.java:1215)
Erel B4X founder Staff member Licensed User Longtime User Jun 28, 2023 #4 Why write the logs like this??? Looks like location services are disabled on the first two devices. Enable them in the settings app. About the third device - uninstall the app and install again. Do you see the location permission request? Upvote 0
Why write the logs like this??? Looks like location services are disabled on the first two devices. Enable them in the settings app. About the third device - uninstall the app and install again. Do you see the location permission request?
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 28, 2023 #5 Erel said: Why write the logs like this??? Click to expand... sorry Erel said: Enable them in the settings app. Click to expand... Yes, it is enabled from app settings Erel said: Do you see the location permission request? Click to expand... Yes, requested and granted. Also in app settings is granted. Upvote 0
Erel said: Why write the logs like this??? Click to expand... sorry Erel said: Enable them in the settings app. Click to expand... Yes, it is enabled from app settings Erel said: Do you see the location permission request? Click to expand... Yes, requested and granted. Also in app settings is granted.
Erel B4X founder Staff member Licensed User Longtime User Jun 29, 2023 #6 FWIW, I've just tested it with an Android 11 device and it works perfectly. Upvote 0