Settings key: <bluetooth_address> is only readable to apps with targetSdkVersion lower than or equal: 31

161 views Asked by At

I have an application in Xamarin.Android which has an API level 33/Android 13, the app integrates with Zebra scanners and in this case I am trying to connect a Zebra DS3678 to my application. In previous versions (API Level < 31 / Android 12) The scanner connects perfectly but now I have the error that is in the title of the question.

Working with API Levels, I always notice that they touch and modify all Bluetooth issues but I couldn't find what should change for API Level 32 or higher (33 in my case)

I contacted the Zebra team but I had no answers (because I think a posible solution is upgrade the Zebra SDK Hander) and I can't downgrade either because it is a corporate app

This is my bluetooth configuration

<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- FOR 30 AND BELOW -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<!-- for 31 and above -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SOCIAL_STREAM" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
1

There are 1 answers

0
Liyun Zhang - MSFT On

According to this case that has the similar error message as yours, this is an issue in the old Zebra SDK, and it was fixed in the newest release version.

So you can try to download the newest Zebra SDK for Xamarin from the official website.