Android 12 Permissions Changes
Overview of Android 12 permissions changes that affect Grouplink SDK.
Adding Permissions to the Android Manifest
The following permissions has to be added to the Android Manifest for the SDK to work properly. If you use location permission on your app, you don't need to add the usesPermissionFlags="neverForLocation" property on the "android.permission.BLUETOOTH_SCAN" permission. These three new permissions must be asked in runtime, and the user must explicitly accept them.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.andriod.settings">
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:minSdkVersion="31"
android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
</manifest>
Gradle configuration
The compileSdk has to be configured to API lvl 31 or above.
Target SDK configurations:
Compatibility mode, target SDK 30 or below.
Updated mode, target SDK 31 or above.
android {
compileSdk 31
defaultConfig {
applicationId "<YOUR APP ID HERE>"
minSdk 21
targetSdk 30 //30 or below for compatibility mode.
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}
On the app dependencies please add the following version of work runtime.
dependencies {
implementation 'androidx.work:work-runtime:2.7.1'
}