question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

android linting keeps failing on Bluetooth permission

See original GitHub issue

Hi,

I’m trying to lint my project, but it keeps failing on this package( It builds and runs perfectly)

Execution failed for task ':react-native-incall-manager:lint'.
> Lint found errors in the project; aborting build.
  
  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...
  
  The first 3 errors (out of 16) were:
  /Users/nsmet/Documents/work/onesmartcontrol/onetouchapp/node_modules/react-native-incall-manager/android/src/main/java/com/zxcpoiu/incallmanager/AppRTC/AppRTCBluetoothManager.java:267: Error: Missing permissions required by BluetoothAdapter.getProfileConnectionState: android.permission.BLUETOOTH [MissingPermission]
              + stateToString(bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET)));
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/nsmet/Documents/work/onesmartcontrol/onetouchapp/node_modules/react-native-incall-manager/android/src/main/java/com/zxcpoiu/incallmanager/AppRTC/AppRTCBluetoothManager.java:367: Error: Missing permissions required by BluetoothHeadset.getConnectedDevices: android.permission.BLUETOOTH [MissingPermission]
      List<BluetoothDevice> devices = bluetoothHeadset.getConnectedDevices();
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/nsmet/Documents/work/onesmartcontrol/onetouchapp/node_modules/react-native-incall-manager/android/src/main/java/com/zxcpoiu/incallmanager/AppRTC/AppRTCBluetoothManager.java:376: Error: Missing permissions required by BluetoothDevice.getName: android.permission.BLUETOOTH [MissingPermission]
        Log.d(TAG, "Connected bluetooth headset: "

I added about every variant of bluetooth permissions, still no luck. At the moment I have this:

 <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

    <!-- If your app targets Android 9 or lower, you can declare
        ACCESS_COARSE_LOCATION instead. -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

RN: 0.60.5 react-native-incall-manager: ^3.2.6

Anyone ran into this problem?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jeevcatcommented, Nov 18, 2020

I’m also facing this issue. I think maybe THIS project needs to add the permission to its manifest file.

0reactions
ggilchrist-ledgercommented, Feb 2, 2022

Me too! Help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bluetooth permissions - Android Developers
If your app makes the current device discoverable to other Bluetooth devices, declare the BLUETOOTH_ADVERTISE permission. If your app communicates with already ...
Read more >
Analyze code with Lint for calls that require permissions
First click on Hector the Inspector (the small icon of a man with a moustache at the very bottom-right of Android Studio).
Read more >
A list of all Android permissions - Hacker News
This keeps Android from having the simple install models we've come to expect ... The linter will give you warnings on some permissions....
Read more >
Android Lint incorrectly reports missing location permission
Lint in Android Studio 3.0c7 shouldn't report "Missing permissions required by TelephonyManager.getAllCellInfo: android.permission.
Read more >
Problem with bluetooth permissions - Processing for Android
java.lang.SecurityException : Need android.permission.BLUETOOTH_CONNECT permission for AttributionSource { uid = 10015, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found