kryops opened a new issue #673:
URL: https://github.com/apache/cordova-plugin-camera/issues/673


   # Bug Report
   
   ## Problem
   
   ### What is expected to happen?
   
   The camera can be opened normally on Android 11 when building with 
`targetSdkVersion=30`.
   
   ### What does actually happen?
   
   ```
   Error: You don't have a default camera.  Your device may not be CTS 
complaint.
   ```
   
   ## Information
   <!-- Include all relevant information that might help understand and 
reproduce the problem -->
   
   The error comes from here: 
https://github.com/apache/cordova-plugin-camera/blob/0333d001c7c2df5418c2a344e275d3b43d99f2d8/src/android/CameraLauncher.java#L305
   
   When removing the condition, the camera launches as expected.
   
   Our current workaround is to stay on `targetSdkVersion=29`.
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   ```
   camera.getPicture(onSuccess, onError, {
       quality: 50,
       destinationType: Camera.DestinationType.FILE_URI,
       sourceType: Camera.PictureSourceType.CAMERA,
       encodingType: Camera.EncodingType.JPEG,
       mediaType: Camera.MediaType.PICTURE,
       allowEdit: false,
       correctOrientation: true,
       targetWidth: 1920,
   });
   ```
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you 
experiencing the issue? -->
   
   Android 11
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   
   cordova 10.0.0
   cordova-android 9.0.0
   cordova-plugin-camera 5.0.0
   cordova-plugin-androidx-adapter 1.1.1
   
   ```
   <preference name="android-minSdkVersion" value="22" />
   <preference name="android-targetSdkVersion" value="30" />
   <preference name="AndroidXEnabled" value="true" />
   ```
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to