问题描述
我最近将我的flutter应用程序的目标sdk升级到了30。此后,无法拍照。它显示了this link中提到的错误。
PlatformException(no_available_camera,没有可用于拍照的相机。,null)。
这与android 11中的package visibility changes有关。现在,第一个链接中有一个解决方案,它通过在清单文件中添加以下行来添加查询设备中安装的所有软件包的权限。
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
哪个为我工作。但是documentation of query_all_packages说:
In the vast majority of cases,however,it's possible to fulfill your app's use cases by
interacting with the set of apps that are visible automatically and by declaring the other
apps that your app needs to access in your manifest file. To respect user privacy,your app
should request the smallest amount of package visibility necessary in order for your app to
work.
In an upcoming policy update,look for Google Play to provide guidelines for apps that need
the QUERY_ALL_PACKAGES permission.
这意味着,仅对于相机应用程序,我们不应要求所有已安装软件包的权限。现在我的问题是,应该在android清单中添加什么以提高相机包的可见性?预先感谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)