react-native-webrtc / react-native-webrtc/react-native-incall-manager

android linting keeps failing on Bluetooth permission

Open
#178 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
597
Forks
201
Avg merge
2h 42m
Merged PRs (30d)
1

Description

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:

* What went wrong:
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 20) were:
  
  /Users/choegeun-won/Documents/GitHub/aha/AhaApp/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_CONNECT [MissingPermission]
              + stateToString(bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET)));
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/choegeun-won/Documents/GitHub/aha/AhaApp/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_CONNECT [MissingPermission]
      List<BluetoothDevice> devices = bluetoothHeadset.getConnectedDevices();
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/choegeun-won/Documents/GitHub/aha/AhaApp/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_CONNECT [MissingPermission]
        Log.d(TAG, "Connected bluetooth headset: "

And above is my AndroidManifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="io.aha.app.aha">

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

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme"
      android:usesCleartextTraffic="true">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
    </application>
</manifest>


RN: 0.66.3
react-native-incall-manager: ^3.3.0

Anyone ran into this problem?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with android/src/main/java/com/zxcpoiu/incallmanager/AppRTC/AppRTCBluetoothManager.java at the reported Bluetooth calls and compare them with the AndroidManifest permissions shown in the issue. Run the Android lint task for react-native-incall-manager; done means the reported BLUETOOTH_CONNECT errors are resolved without disabling abortOnError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, react-native
Domain
mobile-dev, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.