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

EXAMPLE PROJECT #29

Closed
mopilo opened this issue May 21, 2019 · 1 comment
Closed

EXAMPLE PROJECT #29

mopilo opened this issue May 21, 2019 · 1 comment

Comments

@mopilo
Copy link

mopilo commented May 21, 2019

While i ran the example project it worked, but as soon as I connect to my thermal printer the app crashes with this log.
Also I'm using the latest version of flutter. 1.54

D/BluetoothAdapter(21892): isEnabled
D/BluetoothAdapter(21892): cancelDiscovery
D/BluetoothAdapter(21892): 241026643: getState(). Returning 12
W/BluetoothAdapter(21892): getBluetoothService() called with no BluetoothManagerCallback
D/FlutterBluePlugin(21892): android.bluetooth.device.action.ACL_CONNECTED
E/FlutterBluePlugin(21892): Methods marked with @UiThread must be executed on the main thread. Current thread: AsyncTask #2
E/FlutterBluePlugin(21892): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: AsyncTask #2
E/FlutterBluePlugin(21892): 	at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:605)
E/FlutterBluePlugin(21892): 	at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:556)
E/FlutterBluePlugin(21892): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:129)
E/FlutterBluePlugin(21892): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:215)
E/FlutterBluePlugin(21892): 	at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin.lambda$connect$0(FlutterBluetoothSerialPlugin.java:251)
E/FlutterBluePlugin(21892): 	at io.github.edufolly.flutterbluetoothserial.-$$Lambda$FlutterBluetoothSerialPlugin$52C5RUgoP_r70sgAnP8ZXC1Ysz0.run(lambda)
E/FlutterBluePlugin(21892): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
E/FlutterBluePlugin(21892): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/FlutterBluePlugin(21892): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/FlutterBluePlugin(21892): 	at java.lang.Thread.run(Thread.java:761)
E/FlutterBluePlugin(21892): Reply already submitted
E/FlutterBluePlugin(21892): java.lang.IllegalStateException: Reply already submitted
E/FlutterBluePlugin(21892): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:124)
E/FlutterBluePlugin(21892): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:220)
E/FlutterBluePlugin(21892): 	at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin.lambda$connect$0(FlutterBluetoothSerialPlugin.java:254)
E/FlutterBluePlugin(21892): 	at io.github.edufolly.flutterbluetoothserial.-$$Lambda$FlutterBluetoothSerialPlugin$52C5RUgoP_r70sgAnP8ZXC1Ysz0.run(lambda)
E/FlutterBluePlugin(21892): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
E/FlutterBluePlugin(21892): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/FlutterBluePlugin(21892): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/FlutterBluePlugin(21892): 	at java.lang.Thread.run(Thread.java:761)
E/AndroidRuntime(21892): FATAL EXCEPTION: AsyncTask #2
E/AndroidRuntime(21892): Process: io.github.edufolly.flutterbluetoothserialexample, PID: 21892
E/AndroidRuntime(21892): java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(21892): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:124)
E/AndroidRuntime(21892): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:220)
E/AndroidRuntime(21892): 	at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin.lambda$connect$0(FlutterBluetoothSerialPlugin.java:258)
E/AndroidRuntime(21892): 	at io.github.edufolly.flutterbluetoothserial.-$$Lambda$FlutterBluetoothSerialPlugin$52C5RUgoP_r70sgAnP8ZXC1Ysz0.run(lambda)
E/AndroidRuntime(21892): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
E/AndroidRuntime(21892): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/AndroidRuntime(21892): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/AndroidRuntime(21892): 	at java.lang.Thread.run(Thread.java:761)
I/SurfaceView(21892): updateWindow -- onWindowVisibilityChanged, visibility = 8, this = io.flutter.view.FlutterView{98d2f4 VFE...... .F...... 0,0-720,1280}
I/SurfaceView(21892): 10015476 Changes: creating=false format=false size=false visible=true left=false top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceSizeChanged=false mVisible=true mRequestedVisible=false, this = io.flutter.view.FlutterView{98d2f4 VFE...... .F...... 0,0-720,1280}
I/SurfaceView(21892): 10015476 Cur surface: Surface(name=null)/@0x9378c8c, this = io.flutter.view.FlutterView{98d2f4 VFE...... .F...... 0,0-720,1280}
I/SurfaceView(21892): 10015476 New surface: Surface(name=null)/@0x9c1afd5, vis=false, frame=Rect(0, 0 - 720, 1280), this = io.flutter.view.FlutterView{98d2f4 VFE...... .F...... 0,0-720,1280}
I/SurfaceView(21892): 10015476 visibleChanged -- surfaceDestroyed, this = io.flutter.view.FlutterView{98d2f4 VFE...... .F...... 0,0-720,1280}
I/SurfaceView(21892): surfaceDestroyed callback +, this = io.flutter.view.FlutterView{98d2f4 VFE...... .F...... 0,0-720,1280}
D/Surface (21892): Surface::disconnect(this=0x9cb8ee00,api=1)
D/GraphicBuffer(21892): unregister, handle(0xa2e87460) (w:720 h:1280 s:720 f:0x1 u:0x000f02)
D/GraphicBuffer(21892): unregister, handle(0xa2e8c010) (w:720 h:1280 s:720 f:0x1 u:0x000f02)
D/GraphicBuffer(21892): unregister, handle(0xa2e8c550) (w:720 h:1280 s:720 f:0x1 u:0x000f02)
I/SurfaceView(21892): surfaceDestroyed callback -, this = io.flutter.view.FlutterView{98d2f4 VFE...... .F...... 0,0-720,1280}
V/SurfaceView(21892): Layout: x=0 y=0 w=720 h=1280, frame=Rect(0, 0 - 720, 1280), this = io.flutter.view.FlutterView{98d2f4 VFE...... .F...... 0,0-720,1280}
D/SurfaceView(21892): 10015476 windowPositionLostRT RT, frameNr = 0
D/Surface (21892): Surface::disconnect(this=0x9cb8e700,api=1)
D/GraphicBuffer(21892): unregister, handle(0xa2e87540) (w:720 h:1280 s:720 f:0x1 u:0x000f02)
D/GraphicBuffer(21892): unregister, handle(0xa2e87700) (w:720 h:1280 s:720 f:0x1 u:0x000f02)
D/GraphicBuffer(21892): unregister, handle(0xa2e8bec0) (w:720 h:1280 s:720 f:0x1 u:0x000f02)
I/SurfaceView(21892): updateWindow -- onDetachedFromWindow, this = io.flutter.view.FlutterView{98d2f4 VFE...... .F...... 0,0-720,1280}
D/WindowClient(21892): Remove from mViews: DecorView@988545c[MainActivity], this = android.view.WindowManagerGlobal@4dd7b19
E/ActivityThread(21892): Activity io.github.edufolly.flutterbluetoothserialexample.MainActivity has leaked IntentReceiver io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin$1$1@8265c89 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread(21892): android.app.IntentReceiverLeaked: Activity io.github.edufolly.flutterbluetoothserialexample.MainActivity has leaked IntentReceiver io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin$1$1@8265c89 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread(21892): 	at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1201)
E/ActivityThread(21892): 	at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:951)
E/ActivityThread(21892): 	at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1314)
E/ActivityThread(21892): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1294)
E/ActivityThread(21892): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1288)
E/ActivityThread(21892): 	at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:586)
E/ActivityThread(21892): 	at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin$1.onListen(FlutterBluetoothSerialPlugin.java:408)
E/ActivityThread(21892): 	at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:191)
E/ActivityThread(21892): 	at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:170)
E/ActivityThread(21892): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:88)
E/ActivityThread(21892): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:234)
E/ActivityThread(21892): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/ActivityThread(21892): 	at android.os.MessageQueue.next(MessageQueue.java:328)
E/ActivityThread(21892): 	at android.os.Looper.loop(Looper.java:148)
E/ActivityThread(21892): 	at android.app.ActivityThread.main(ActivityThread.java:6251)
E/ActivityThread(21892): 	at java.lang.reflect.Method.invoke(Native Method)
E/ActivityThread(21892): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
E/ActivityThread(21892): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
I/art     (21892): Enter while loop.
D/OpenGLRenderer(21892): ~CanvasContext() 0xa2ec5000
@AgainPsychoX
Copy link
Collaborator

This is the same issue as #36, and it is solved by #35 and the #35 PR is coming very soon so I am closing the issue for now.

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

2 participants