flutter条码扫描仪android问题
我是 flutter 新手,我为 ios 和 android 创建了一个条形码读取器应用程序。我使用 flutter_barcode_scanner 插件:2.0.0 或任何插件,而在 ios 上,当我打开相机时没有问题,而在 android 上,在通过权限并正确管理它们后,我会得到黑屏。 我使用全新的flutter sdk 2.11,我不明白为什么它不能在android中工作,尽管我已经看过很多教程并一步一步遵循,有人知道这可能取决于什么吗?
时的日志
这是我尝试打开相机W/m.falco.lettur(18788) :访问隐藏方法 Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (浅灰名单,链接)
W/m.falco.lettur(18788):访问隐藏字段 Landroid/graphics/Insets;->left:I (浅灰名单,链接
W/m.falco.lettur(18788):访问隐藏字段字段 Landroid/graphics/Insets;->right:I(浅灰名单,链接)
W/m.falco.lettur(18788): 访问隐藏字段 Landroid/graphics/Insets;->top:I (浅灰名单,链接)
问题是这样的: 如果我从 mainPageNavigator 打开相机一切正常,而从其他页面打开则有黑屏,仅在 Android 中。
I am new to flutter, I have created a barcode reader app for ios and android. I use the flutter_barcode_scanner plugin: 2.0.0 or any, while on ios I have no problem when I open the camera, with android after passing the permissions and having managed them correctly I get a black screen.
I use the brand new flutter sdk 2.11 and I don't understand why it can't work in android, although I have seen many tutorials and followed step by step, does anyone have any idea what this might depend on?
This is the log when i try to open camera
W/m.falco.lettur(18788): Accessing hidden method
Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
W/m.falco.lettur(18788): Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking
W/m.falco.lettur(18788): Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
W/m.falco.lettur(18788): Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
the problem is this:
if i open camera from mainPageNavigator all is ok,while instead open from the other page i have black screen,only in android.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您能否显示您在 androidmanifest.xml 中传递的权限,
您需要传递这些权限
Can you show the permission that you are passing in androidmanifest.xml
you need to pass these permissions
访问相机权限
路径:
android/app/AndroidManifest.xml
Access Camera Permission
path:
android/app/AndroidManifest.xml
您可以在 android/app/src/main/AndroidManifest.xml 之前添加此内容吗?应用> ?
Can you add this in your android/app/src/main/AndroidManifest.xml before < application> ?
<uses-feature android:name="android.hardware.camera" />