Unable to connect Bluetooth Classic on Android 12 after rebuilding the project

I developed an application that reads data from Bluetooth Classic, and it worked perfectly on Android 10 and Android 12 (I built the APK on January 16, 2025, and it worked fine).

Today, I made some minor changes (unrelated to Bluetooth) and built a new APK. However, Android 12 can no longer connect to Bluetooth and shows the error:

“Error 507: Unable to connect. Is the device turned on?”

when trying to connect from the ListPicker, which displays the name and address of Bluetooth devices. Android 10 still works fine.

To troubleshoot, I installed the older APK version (built on January 16, 2025) on Android 12, and it still works perfectly. However, when I rebuilt the same project, the issue persisted.

:small_blue_diamond: Questions:

  • What could be causing this issue?
  • Are there any changes in Android 12 that might affect Bluetooth Classic connections?
  • How can I resolve this problem?

Thanks in advance for any advice! :pray:

Ask for permission

Taifun

1 Like

I have already granted the BluetoothConnect permission.

I also added BluetoothScan, but the result remains the same.

I tested it on Android 14, and it works fine.

It seems to be an issue with my phone. I am using a Xiaomi 10T Pro.

Do you have any other suggestions?

It would really help if you provided a screenshot your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun

1 Like

Thank you
This is my Bluetooth section.

You ask for borh permissions at rhe same time
Do it as suggested here

Taifun

1 Like

Where can I find the block Call GetASD1 Is.Companion?

You can get it here

Taifun

2 Likes

The error still persists. I forgot to mention that it can still retrieve the Bluetooth address and name, but it cannot connect. I tried creating a blank program with the blocks you suggested, and it worked because it only displayed the list of devices. However, in my project, the error occurs after pressing the connect.

image

It would really help if you provided an updated screenshot your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun

1 Like

This is my Bluetooth section after update.

After BluetoothScan has been granted then ask for BluetoothConnect


Taifun

1 Like

Thank you.
I will try again on Monday.

I tried it and got the same result.
Do you have any other suggestions?

How do you test? Companion app? Clear TinyDB and try again
Also what about building the project and test using the apk file?

Taifun

1 Like

I tested both the APK and the Companion app, and neither of them worked. I tried uninstalling the Companion app and reinstalling it, but it still doesn’t work.