java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission

18,740

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.

Share:
18,740
Admin
Author by

Admin

Updated on June 18, 2022

Comments

  • Admin
    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 in AndroidManifest file.