[ionic 4] How to remove Capacitor from app?

I added @capacitor to my ionic 4 app and now I want to remove it and just focus on ionic-native.

How can I remove @capacitor?

Could you copy your own code into a new solution?

I wish there was an easier option… Would something like this work?

npm uninstall --save @capacitor/cli @capacitor/core

Hello,

as far as I know. Yes.

By the way. Do you have problems with capacitor? Maybe you need to add /ngx to your import path to use ionic native on capacitor.

Best regards, anna-liebt

Hello Anna, I don’t have problems with capacitor but I don’t see all the plugins I need in capacitor yet. So I’ll stick with ionic-native for now for my ionic4 app.

hello,
yes capacitor is on beta, also the docs are not really good.
If you wanna stay a capacitor and will use native plugins, then you have to install ionic native plugins with Version 5.x.xbeta. Take a look to your package.json you have with capacitor something like

"@ionic-native/splash-screen": "5.0.0-beta.21",

If you install, like in ionic native plugin described, then you must change after installation the ionic-native version to 5.0.0-beta.21. If you use visual code, then there are extension that helps to find beta versions. You can change the version by hand and run after saving npm i.

To use the native plugin from code side in ts you need to add to the import path /ngx
like

import { Whatever} from '@ionic-native/whatever/ngx';

This should run most plugins, but yes capacitor is beta.

Best regrads, anna-liebt

1 Like