react-native-syan-image-picker
react-native-syan-image-picker copied to clipboard
android9.0 拍照问题
安卓9.0手机拍拍照后报错,几率AS里的错误为
Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
然后通过检查发现可能的原因是调用的原生组件里调用了一个setSupportActionBar导致冲突
后来找到了解决办法:
在as项目下的values->styles.xml 文件里添加一个自定义的样式
<style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style>
然后在 清单文件AndroidManifest.xml里面修改application的主题
android:theme="@style/AppTheme.NoActionBar"
并添加tools:replace="android:theme"
属性
然后重新进行拍照 发现成功!
嗯, 是合适的解决方案, 也可参考https://github.com/LuckSiege/PictureSelector/issues/603
也存在这个问题,升级到最新就行了
试过目前看到的 issue 方案,都不行,,,Android 9 以上,拍照直接返回 undefined
请问有解决方案吗