Hello, I have an Ionic project that uses Capacitor. Now I want use an Cordova Plugin. After I run the following command, the things in the picture apprear:
I have no idea what’s in your image, or what you’re talking about “clicking” on, so here is the documentation about using Cordova plugins with Capacitor. Near it should be a list of known incompatible plugins.
but the catch here throsw the error: cordova_not_available which of course is correct because I use capacitor and not cordova but I thought it would work anyway?
Are you trying this on the desktop/laptop? well it wont work you need a cordova environment to make it works. so that means you need to run in a real mobile device or emulator. Do you have android studio installed?
Or xcode if you are using mac?
Also it is telling you cordova_not_available because you plugin is based or needs a cordova environment to work. You using capacitor does not mean your plugin does not need cordova under the hood. When you do:
npm install @ionic-native/text-to-speech
Your are installing the “capacitor” wrapper, which is used for autocompletion on your Ide and avoid complier errors…
npm install text-to-speech
Your are installing the actual plugin which probably was generated at first with plugman or some kind of tool.
npx cap sync
The sync command updates dependencies, and copies any web assets to your project.
Also I believe this is the wrong plugin. Did you get text-to-speech from the docs? I believe the correct plugin is cordova-plugin-tts and commands should be:
npm install cordova-plugin-tts
npm install @ionic-native/text-to-speech
ionic cap sync
Still you need to use a emulator or real device. Most of the time this plugin are intended to help when you want your app support mobile devices.