3

After changing my targetSdk to 32, I get the following error:

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

I think this is happening while checking permissions while loading my app.

Sean
  • 2,632
  • 2
  • 27
  • 35
  • Does your app include any third party libraries especially for tracking/showing ads? – Robert May 17 '22 at 09:25
  • Yes, it does. The library causing the issue is the Zebra Scanner SDK. – Sean May 17 '22 at 18:52
  • @Sean did you figure out what the solution was ? – nirasp Jun 15 '22 at 16:04
  • Unfortunately, no. I've reverted to targetSdk 31 and I'm waiting for an update to the Zebra scanner SDK to switch to 32. I've seen some things now require a target sdk of 32. Worst case, I'll drop support for the barcode scanner until they update it or I find a workaround. – Sean Jun 24 '22 at 16:12
  • did you find a workaround for this? i am getting the same issue with bluetooth_name – Mahmoud Omara Aug 11 '22 at 13:02
  • Unfortunately, no. I switched back to 31. I'm waiting for an update for the library causing the issue. – Sean Aug 11 '22 at 13:32
  • I have same problem but don't have Zebra Scanner SDK. My compileSdkVersion/targetSdk is 33 – Adrian Grygutis Sep 27 '22 at 06:08
  • But it looks like OneSignal has the same problem: https://github.com/OneSignal/onesignal-expo-plugin/issues/107 – Adrian Grygutis Sep 27 '22 at 06:15
  • Zebra has released a new scanner SDK version that fixes this issue. – Sean Mar 11 '23 at 19:57

2 Answers2

3

Issue is due to few parameters are annotated with maxTargetSdk = Build.VERSION_CODES.S enter image description here

For bluetooth_name I found the alternative and reading device_name using below code:

Settings.Global.getString(application.contentResolver, Settings.Global.DEVICE_NAME)
        ?: "UNKNOWN"
0

I solved this for me by downgrading the gradle version to 7.0.4 and setting both the compileSdkVersion and the targetSdkVersion to 31.

Unfortunately it's not the fix that i wanted but this is an intermediate step for now to continue working

EMart
  • 65
  • 4
  • 1
    You shouldn't need to downgrade gradle. I assume you actually mean the Android Gradle Plugin. Just lowering your target SDK version should work. Do you know what library is causing this issue? – Sean Mar 11 '23 at 19:55