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

[Help]: D/BluetoothLeScanner( 4064): could not find callback wrapper #778

Closed
1 task done
Rizza-Rabe opened this issue Jan 31, 2024 · 9 comments
Closed
1 task done
Labels
help Questions, help, observations, or possible bugs

Comments

@Rizza-Rabe
Copy link

Requirements

  • I've looked at the README 'Common Problems' section

Have you checked this problem on the example app?

Yes

FlutterBluePlus Version

1.31.12

Flutter Version

3.10.6

What OS?

Android

OS Version

Android 13.

Bluetooth Module

AT-09 BLE

What is your problem?

Does not show devices. Always throw: could not find callback wrapper

Logs

I/BluetoothAdapter( 4064): STATE_ON
I/BluetoothAdapter( 4064): STATE_ON
D/BluetoothLeScanner( 4064): could not find callback wrapper
@Rizza-Rabe Rizza-Rabe added the help Questions, help, observations, or possible bugs label Jan 31, 2024
@chipweinberger
Copy link
Owner

chipweinberger commented Jan 31, 2024

show more logs from the example app.

D/BluetoothLeScanner( 4064): could not find callback wrapper

the is a debug log. It means you are calling stopScan, but no scan is currently in progress.

https://stackoverflow.com/questions/40862767/bluetoothlescanner-could-not-find-callback-wrapper

@chipweinberger chipweinberger changed the title [Help]: could not find callback wrapper [Help]: D/BluetoothLeScanner( 4064): could not find callback wrapper Jan 31, 2024
@Rizza-Rabe
Copy link
Author

Rizza-Rabe commented Jan 31, 2024

if (await Permission.bluetoothScan.isDenied) {
      await Permission.bluetoothScan.request();
    }
    if (await Permission.bluetoothConnect.isDenied) {
      await Permission.bluetoothConnect.request();
    }
    if (await Permission.location.isDenied) {
      await Permission.location.request();
    }

    var subscription = FlutterBluePlus.onScanResults.listen((result) {
      Utility().printLog("OnScanResult: $result");
    });

    FlutterBluePlus.cancelWhenScanComplete(subscription);

    await FlutterBluePlus.startScan(
      timeout: const Duration(seconds: 10),
    );

@Rizza-Rabe
Copy link
Author

Im unable to get some devices.

@Rizza-Rabe
Copy link
Author

Rizza-Rabe commented Jan 31, 2024

D/[FBP-Android](14010): [FBP] onMethodCall: startScan
I/ViewRootImpl@1c09fe3[MainActivity](14010): MSG_WINDOW_FOCUS_CHANGED 0 0
I/ViewRootImpl@1c09fe3[MainActivity](14010): stopped(false) old = false
I/DecorView(14010): notifyKeepScreenOnChanged: keepScreenOn=false
I/MSHandlerLifeCycle(14010): removeMultiSplitHandler: no exist. decor=DecorView@866de74[MainActivity]
I/ViewRootImpl@1c09fe3[MainActivity](14010): performTraversals params={(0,0)(fillxfill) sim={adjust=resize forwardNavigation} ty=BASE_APPLICATION fmt=TRANSLUCENT wanim=0x1030001
I/ViewRootImpl@1c09fe3[MainActivity](14010):   fl=81810100
I/ViewRootImpl@1c09fe3[MainActivity](14010):   pfl=12020040
I/ViewRootImpl@1c09fe3[MainActivity](14010):   vsysui=500
I/ViewRootImpl@1c09fe3[MainActivity](14010):   bhv=DEFAULT
I/ViewRootImpl@1c09fe3[MainActivity](14010):   fitSides= naviIconColor=0}
I/ViewRootImpl@1c09fe3[MainActivity](14010): performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(0,0)(fillxfill) sim={adjust=resize forwardNavigation} ty=BASE_APPLICATION fmt=TRANSLUCENT wanim=0x1030001
I/ViewRootImpl@1c09fe3[MainActivity](14010):   fl=81810100
I/ViewRootImpl@1c09fe3[MainActivity](14010):   pfl=12020040
I/ViewRootImpl@1c09fe3[MainActivity](14010):   vsysui=500
I/ViewRootImpl@1c09fe3[MainActivity](14010):   bhv=DEFAULT
I/ViewRootImpl@1c09fe3[MainActivity](14010):   fitSides= naviIconColor=0}
I/ViewRootImpl@1c09fe3[MainActivity](14010): updateBlastSurfaceIfNeeded mBlastBufferQueue=0xb40000775b660c00 isSameSurfaceControl=true
I/BLASTBufferQueue(14010): update, w= 1080 h= 2408 mName = ViewRootImpl@1c09fe3[MainActivity] mNativeObject= 0xb40000775b660c00 sc.mNativeObject= 0xb4000077c7b187a0 format= -3 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:2898 android.view.ViewRootImpl.relayoutWindow:9847 android.view.ViewRootImpl.performTraversals:3884 android.view.ViewRootImpl.doTraversal:3116 android.view.ViewRootImpl$TraversalRunnable.run:10885 android.view.Choreographer$CallbackRecord.run:1301 
I/ViewRootImpl@1c09fe3[MainActivity](14010): Relayout returned: old=(0,0,1080,2408) new=(0,0,1080,2408) req=(1080,2408)0 dur=10 res=0x0 s={true 0xb4000077d1226000} ch=false seqId=0
I/ViewRootImpl@1c09fe3[MainActivity](14010): updateBoundsLayer: t = android.view.SurfaceControl$Transaction@5689421 sc = Surface(name=Bounds for - com.zz.arduino.training.pad.training_pad/com.zz.arduino.training.pad.training_pad.MainActivity@1)/@0xdcdc791 frame = 3
I/ViewRootImpl@1c09fe3[MainActivity](14010): mWNT: t=0xb40000775b78c200 mBlastBufferQueue=0xb40000775b660c00 fn= 3 caller= android.view.ViewRootImpl.prepareSurfaces:2985 android.view.ViewRootImpl.performTraversals:4233 android.view.ViewRootImpl.doTraversal:3116 
I/ViewRootImpl@1c09fe3[MainActivity](14010): MSG_WINDOW_FOCUS_CHANGED 1 0
I/ViewRootImpl@1c09fe3[MainActivity](14010): mThreadedRenderer.initializeIfNeeded()#2 mSurface={isValid=true 0xb4000077d1226000}
D/InputMethodManager(14010): startInputInner - Id : 0
I/InputMethodManager(14010): startInputInner - mService.startInputOrWindowGainedFocus
D/[FBP-Android](14010): [FBP] onMethodCall: stopScan
I/BluetoothAdapter(14010): STATE_ON
I/BluetoothAdapter(14010): STATE_ON
D/BluetoothLeScanner(14010): could not find callback wrapper

@chipweinberger
Copy link
Owner

use example app.

@chipweinberger
Copy link
Owner

any updates. theres not much actionable here.

@Xelopakson
Copy link

did you fix this ?

@chipweinberger
Copy link
Owner

chipweinberger commented Mar 29, 2024

there's nothing to fix. BluetoothLeScanner: could not find callback wrapper just means you are calling stopScan but there is no scan currently in progress.

https://stackoverflow.com/questions/40862767/bluetoothlescanner-could-not-find-callback-wrapper


that said, I added a fix with a better log message: 69ccb70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help Questions, help, observations, or possible bugs
Projects
None yet
Development

No branches or pull requests

3 participants