Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 12 error: could not find callback wrapper #622

Open
lpc-nz opened this issue May 17, 2022 · 6 comments
Open

Android 12 error: could not find callback wrapper #622

lpc-nz opened this issue May 17, 2022 · 6 comments

Comments

@lpc-nz
Copy link

lpc-nz commented May 17, 2022

Hi everyone
I am working on the Bluetooth connection and I have some problems with the new Android version.
Most Android phones work perfectly except for some Samsung phones (S21, S21 +).
Does anyone know about these issues? Please give me some help.

I have tried to add permission but it still has no luck.

minSdkVersion 21
targetSdkVersion 31
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
I/flutter (23844): DeviceService - waiting for power on - BluetoothState.POWERED_ON
I/flutter (23844): DevicesScanningBloc - start scan
D/com.polidea.flutter_ble_lib.FlutterBleLibPlugin(23844): on native side observed method: startDeviceScan
I/BluetoothAdapter(23844): STATE_ON
I/BluetoothAdapter(23844): STATE_ON
I/BluetoothAdapter(23844): STATE_ON
I/BluetoothAdapter(23844): STATE_ON
D/BluetoothLeScanner(23844): Start Scan with callback
I/BluetoothAdapter(23844): STATE_ON
I/BluetoothAdapter(23844): STATE_ON
D/BluetoothLeScanner(23844): could not find callback wrapper
@iJack93
Copy link

iJack93 commented Nov 9, 2022

Any update on this?

@georgechem
Copy link

Have the same issue with Bluetooth on android 12, on 10 and 11 works perfectly. Adding additional permissions required by Android 12 and updating OS to the latest version did not change anything.

@iJack93
Copy link

iJack93 commented Mar 31, 2023

@georgechem I've found that you have to add at first these permissions inside the AndroidManifest and through a Permission manager ask for them to the user

    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

Then you have to target at least api 33 of Android, otherwise it won't work and won't event ask for those.
I think that this is not related to this library, but to Android itself.

@georgechem
Copy link

Thanks a lot I will try.

@georgechem
Copy link

Screen Shot 2023-03-31 at 13 50 46

It did not work - looks like permissions are granted but nothing happen beside this. It is SONY-XQ-AS-52

@rohailmansab
Copy link

Capture
This is my Flutter app error in the Bluetooth. Can someone solve my error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants