Problem
In Cordova Android when clicking on an html type="file" input a system file picker appears instead of camera options.
What is expected to happen?
If I perform the same action in the system browser I get the expected dialog:
Version information
"cordova-android": "^8.0.0",
"cordova-plugin-camera": "^4.1.0"
cordova-cli 9.0.0
Full test case repo here
This is my first Android Cordova application, am I missing a certain plugin? I don't remember being asked for permission to use the camera at any stage so I wonder if I'm missing something in the config.xml linked above?
You need to set the
capture
andaccept
attributes like below:EDIT
Also, make sure your
platforms/android/AndroidManifest.xml
includes the following elements:If they don't already exist, create file
platforms/android/res/xml/file_paths.xml
containing:and file
platforms/android/res/xml/camera_provider_paths.xml
:If that still does not seem to do the trick, you may additionally need to add/modify the
SystemWebChromeClient.java
file in theplatforms/android/CordovaLib/src/org/apache/cordova/engine
directory to include the following: