flutter_bluetooth_serial 0.4.0 无法在 andriod 12 中工作。我制作了从 ardino 读取数据并安装 flutter 应用程序的应用程序。 andriod 11 工作正常,但 andriod 12 不工作
Launching lib\main.dart on SM M025F in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
V/FlutterBluetoothSerial(30824): Attached to engine
Debug service listening on ws://127.0.0.1:49559/7e7uO_cpk_Y=/ws
Syncing files to device SM M025F...
I/Gralloc4(30824): mapper 4.x is not supported
W/Gralloc3(30824): mapper 3.x is not supported
W/Gralloc4(30824): allocator 4.x is not supported
W/Gralloc3(30824): allocator 3.x is not supported
E/MethodChannel#flutter_bluetooth_serial/methods(30824): Failed to handle method call
E/MethodChannel#flutter_bluetooth_serial/methods(30824): java.lang.SecurityException: Permission Denial: starting Intent { act=android.bluetooth.adapter.action.REQUEST_ENABLE cmp=com.android.settings/.bluetooth.RequestPermissionActivity } from ProcessRecord{2c992ce 30824:com.pureAlpha.dev.shoe/u0a258} (pid=30824, uid=10258) requires android.permission.BLUETOOTH_CONNECT
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.os.Parcel.createExceptionOrNull(Parcel.java:2438)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.os.Parcel.createException(Parcel.java:2422)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.os.Parcel.readException(Parcel.java:2405)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.os.Parcel.readException(Parcel.java:2347)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2897)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1743)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.app.Activity.startActivityForResult(Activity.java:5473)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at androidx.core.app.ActivityCompat.startActivityForResult(ActivityCompat.java:237)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin$FlutterBluetoothSerialMethodCallHandler.onMethodCall(FlutterBluetoothSerialPlugin.java:585)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.os.Looper.loopOnce(Looper.java:226)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.os.Looper.loop(Looper.java:313)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at android.app.ActivityThread.main(ActivityThread.java:8751)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): Caused by: android.os.RemoteException: Remote stack trace:
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at com.android.server.wm.ActivityTaskSupervisor.checkStartAnyActivityPermission(ActivityTaskSupervisor.java:1334)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1262)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:893)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1891)
E/MethodChannel#flutter_bluetooth_serial/methods(30824): at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1762)
E/MethodChannel#flutter_bluetooth_serial/methods(30824):
D/AndroidRuntime(30824): Shutting down VM
E/AndroidRuntime(30824): FATAL EXCEPTION: main
E/AndroidRuntime(30824): Process: com.pureAlpha.dev.shoe, PID: 30824
E/AndroidRuntime(30824): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1337, result=0, data=null} to activity {com.pureAlpha.dev.shoe/com.pureAlpha.dev.shoe.MainActivity}: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(30824): at android.app.ActivityThread.deliverResults(ActivityThread.java:5946)
E/AndroidRuntime(30824): at android.app.ActivityThread.handleSendResult(ActivityThread.java:5985)
E/AndroidRuntime(30824): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:54)
E/AndroidRuntime(30824): at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
E/AndroidRuntime(30824): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(30824): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(30824): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
E/AndroidRuntime(30824): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(30824): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(30824): at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime(30824): at android.app.ActivityThread.main(ActivityThread.java:8751)
E/AndroidRuntime(30824): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(30824): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/AndroidRuntime(30824): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
E/AndroidRuntime(30824): Caused by: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(30824): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:435)
E/AndroidRuntime(30824): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:263)
E/AndroidRuntime(30824): at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin.lambda$onAttachedToActivity$0$io-github-edufolly-flutterbluetoothserial-FlutterBluetoothSerialPlugin(FlutterBluetoothSerialPlugin.java:395)
E/AndroidRuntime(30824): at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin$$ExternalSyntheticLambda0.onActivityResult(Unknown Source:2)
E/AndroidRuntime(30824): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:807)
E/AndroidRuntime(30824): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:430)
E/AndroidRuntime(30824): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:811)
E/AndroidRuntime(30824): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:771)
E/AndroidRuntime(30824): at android.app.Activity.dispatchActivityResult(Activity.java:8659)
E/AndroidRuntime(30824): at android.app.ActivityThread.deliverResults(ActivityThread.java:5939)
E/AndroidRuntime(30824): ... 13 more
I/Process (30824): Sending signal. PID: 30824 SIG: 9
Lost connection to device.
我也有同样的问题。你找到解决办法了吗?