java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission
Solution 1
Got the exact error message.
Took me an hour to realize that the bluetooth on the phone is not enabled. After turning it on, it works as expected.
Solution 2
You can't use this permission if your app is a third party app (non-system app). To learn more, see Android API: BLUETOOTH_PRIVILEGED
Solution 3
I run on this error, and only I can say, you need to install your app as a system privileged app, to go to system folder and try to copy app to the app folder or priv_app folder. On my Android platform, when I made folder inside priv_app folder for my app and copied my apk to it and restarted Android, everything worked OK. I my case I added in manifest all this permissions at the beginning, but it worked only after this step above.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on June 18, 2022Comments
-
Admin about 2 years
Has anyone meet the same problem as the following error message shows when calling
bluetoothDeive.createBond()
method with android 4.4 api?java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission
Note:
BLUETOOTH_ADMIN
permission is already included inAndroidManifest
file.