I have installed “Camera” plugin,
Typed this, (and imports)
constructor(public camera: Camera)
takePicture()
{
let options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.PNG,
mediaType: this.camera.MediaType.PICTURE
};
this.camera.getPicture(options).then(url => {
this.path = url;
}, (err) => {
alert("Error " + err);
});
and before this, emulator is working. Now says
UnhandledPromiseRejectionWarning: Command failed with exit code 1 Error output:
Exception in thread "main" java.lang.NoSuchMethodError: com.android.prefs.Android
Location.getAvdFolder()Ljava/lang/String;
at com.android.sdklib.tool.AvdManagerCli.init(AvdManagerCli.java:278)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:210)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
at ChildProcess.whenDone (C:\Users\tensor\swiitetapp\platforms\android/cordov
a\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:
node:7652) UnhandledPromiseRejectionWarning: Unhandled promise rejection.
rror originated either by throwing inside of an async function without a
lock, or by rejecting a promise which was not handled with .catch(). (rej
id: 1)
node:7652) [DEP0018] DeprecationWarning: Unhandled promise rejections are
ated. In the future, promise rejections that are not handled will termina
Node.js process with a non-zero exit code.
My application works on
ionic serve
.