jwburnside opened a new issue #658:
URL: https://github.com/apache/cordova-plugin-camera/issues/658
# Bug Report
## Problem
When launching the camera on an emulated Android 11 device an error is
thrown on **this.camera.getPicture()**
Error is:
err: "Attempt to invoke virtual method 'boolean java.io.File.mkdirs()' on a
null object reference"
### What is expected to happen?
Camera should function as it does on earlier emulated devices (<=29).
### What does actually happen?
After camera permission has been accepted, the app crashes completely (could
not retrieve error in logcat). Subsequent attempts to launch the camera result
in the error described above.
## Information
<!-- Include all relevant information that might help understand and
reproduce the problem -->
- Ran with newly created project with only the camera plugin installed.
- Tested on several emulated Android 11 devices.
- No issues with physical Pixel 2 and Pixel 3 devices running Android 11.
### Command or Code
```
<!-- What command or code is needed to reproduce the problem? -->
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
const base64Image = 'data:image/jpeg;base64,' + imageData;
}, (err) => {
console.log('err: ' + JSON.stringify(err));
// Handle error
});
```
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you
experiencing the issue? -->
- Emulated Android 11 devices (API 30)
### 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.
-->
Ionic CLI : 6.4.0
(/Users/j/.nvm/versions/node/v10.13.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.3.2
@angular-devkit/build-angular : 0.1000.8
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 9.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0,
cordova-plugin-ionic-webview 4.2.1, (and 5 other plugins)
Utility:
cordova-res (update available: 0.15.1) : 0.14.0
native-run : 1.0.0
System:
Android SDK Tools : 26.1.1 (/Users/j/Library/Android/sdk)
ios-sim : 8.0.1
NodeJS : v10.13.0
(/Users/j/.nvm/versions/node/v10.13.0/bin/node)
npm : 6.14.5
OS : macOS Catalina
Xcode : Xcode 11.6 Build version 11E708
## 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]