rhymelph / r_scan

📷🖨Flutter二维码&条形码扫描插件,支持相机、文件、链接、Uint8List类型扫描
https://juejin.im/post/5dd8efb1e51d452314438515
BSD 3-Clause "New" or "Revised" License
119 stars 79 forks source link

扫描界面热重载会黑屏 #6

Closed shingohu closed 4 years ago

shingohu commented 4 years ago

RT

parcool commented 4 years ago

不是热重装也经常黑屏。。。多次打开就出现了

parcool commented 4 years ago
E/flutter (27414): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Neither user 10646 nor current process has android.permission.WAKE_LOCK., null)
E/flutter (27414): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (27414): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (27414): <asynchronous suspension>
E/flutter (27414): #2      AndroidViewController._create (package:flutter/src/services/platform_views.dart:640:54)
E/flutter (27414): #3      AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:557:14)
E/flutter (27414): #4      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:174:29)
E/flutter (27414): #5      RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:155:5)
E/flutter (27414): #6      RenderObject.layout (package:flutter/src/rendering/object.dart:1703:9)
E/flutter (27414): #7      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (27414): #8      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (27414): #9      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (27414): #10     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (27414): #11     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:163:11)
E/flutter (27414): #12     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:477:7)
E/flutter (27414): #13     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:232:7)
E/flutter (27414): #14     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:391:14)
E/flutter (27414): #15     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1584:7)
E/flutter (27414): #16     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:844:18)
E/flutter (27414): #17     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:344:19)
E/flutter (27414): #18     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:774:13)
E/flutter (27414): #19     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:283:5)
E/flutter (27414): #20     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1102:15)
E/flutter (27414): #21     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1041:9)
E/flutter (27414): #22     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:957:5)
E/flutter (27414): #23     _rootRun (dart:async/zone.dart:1126:13)
E/flutter (27414): #24     _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (27414): #25     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter (27414): #26     _invoke (dart:ui/hooks.dart:259:10)
E/flutter (27414): #27     _drawFrame (dart:ui/hooks.dart:217:3)
parcool commented 4 years ago

加上这一句就没出现了:<uses-permission android:name="android.permission.WAKE_LOCK" />

shingohu commented 4 years ago

加上这一句就没出现了:<uses-permission android:name="android.permission.WAKE_LOCK" />

热重载还是会吧.这个是官方PlatformView的bug

parcool commented 4 years ago

@shingohu 会哦,不仅仅是热重装,我在正常情况下也遇到过2次,不知道为什么。。。

rhymelph commented 4 years ago

已更新到 v0.1.4版本,新增基于Texture组件的二维码扫描相机RScanCamera,👏👏欢迎使用