Error: Java exception was raised during method invocation Android 10

I am using iframe inside the app, but after closing the iframe page it does not allow me to access
camera and native plugins
But this happens only in android 10

Got this error
Error: Java exception was raised during method invocation
at androidExec (cordova.js:960)
at Object.cameraExport.getPicture (Camera.js:156)
at callCordovaPlugin (vendor.js:95327)
at vendor.js:95353
at vendor.js:78428
at new t (polyfills.js:3)
at tryNativePromise (vendor.js:78427)
at getPromise (vendor.js:78435)
at wrapPromise (vendor.js:95336)
at Camera. (vendor.js:95490)
at Camera.value [as getPicture] (vendor.js:196090)
at AddPostFeedComponent.webpackJsonp.646.AddPostFeedComponent.captureIOSImage (main.js:9163)
at Object.handler (main.js:9140)
at AlertCmp.btnClick (vendor.js:79294)
at Object.eval [as handleEvent] (AlertCmp.html:1)
at handleEvent (vendor.js:13609)
at callWithDebugContext (vendor.js:15094)
at Object.debugHandleEvent [as handleEvent] (vendor.js:14681)
at dispatchEvent (vendor.js:10058)
at vendor.js:10672
at HTMLButtonElement. (vendor.js:33170)
at HTMLButtonElement.wrapped (vendor.js:244576)
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:4974)
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)
at e.invokeTask [as invoke] (polyfills.js:3)
at p (polyfills.js:2)
at HTMLButtonElement.v (polyfills.js:2)

Thanks in advance.

1 Like

It is becoz of iframe , So created iframe using typescript inst of html, I hope It will be helpful for someone

var target = document.getElementById("iframeParent");
var newFrame = document.createElement("iframe");
 newFrame.setAttribute("src", "srcstring");
 newFrame.setAttribute("frameBorder", "0");
 if (target !== null) {
1 Like

Great! :+1: :+1: :+1:

1 Like