Ionic 5: Error: The old format of this exec call has been removed (deprecated since 2.1)

I am working with Ionic 5, using capacitor and I tried to use the PreviewAnyFile plugin. after installing the plugging as directed by (this)[PreviewAnyFile - Ionic Documentation]. I passed it to my constructor and called it by

    this.documentViewer
        .previewBase64(file, { name: filename, mimeType: fileMimeType })
        .then((res: any) => console.log(res))
        .catch((error: any) => console.error(error));
    });

and I get :
Error: The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, ‘Service’, ‘action’, [ arg1, arg2 ]);
at capacitorExec (capacitor-runtime.js:1978)
at execProxy (capacitor-runtime.js:2114)
at PreviewAnyFile.previewBase64 (capacitor-runtime.js:3088)
at callCordovaPlugin (/vendor-es2015.js:137148)
at /vendor-es2015.js:136961
at /vendor-es2015.js:136921
at new ZoneAwarePromise (/polyfills-es2015.js:3587)
at tryNativePromise (/vendor-es2015.js:136920)
at getPromise (/vendor-es2015.js:136939)
at wrapPromise (/vendor-es2015.js:136944)

Please any way out of this? I use other plugins in the app, like launch navigator and call number and they worked fine.

Perhaps relevant?

Thanks. @rapropos the link you shared gave me good progress. but i get the error “cannot write the base64 to a file”. especially in case of pdf files. this file string gives the error and it seem to be a correct base64.

Following this link @rapropos shared, you have to ensure your file name has no space else you get “cannot write the base64 to a file”. just FYI for others. Thanks @rapropos