突然发现发布的安卓应用无法打开相机,在androidstudia中看了一下log,报出了如下内容
Error: You don't have a default camera. Your device may not be CTS complaint.
解决方式:
在 config.xml中的<platform name="android">标签中添加以下内容
<config-file parent="/*" target="AndroidManifest.xml">
<queries>
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
<intent>
<action android:name="android.intent.action.GET_CONTENT" />
</intent>
</queries>
</config-file>
If you're using allowEdit
, you should also add android.intent.action.PICK
.