# Switching to Capacitor

**URL:** <https://forum.ionicframework.com/t/switching-to-capacitor/139286>\
**Category:** Ionic Framework\
**Created:** [August 22, 2018, 1:38pm UTC](https://forum.ionicframework.com/t/switching-to-capacitor/139286 "2018-08-22T13:38:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![developergeme](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@developergeme](https://forum.ionicframework.com/u/developergeme)\
**Post date:** [August 22, 2018, 1:38pm UTC](https://forum.ionicframework.com/t/switching-to-capacitor/139286/1 "2018-08-22T13:38:02Z")

</div>

After switching to Capacitor and following instructions about removing the Cordova Plugin SplashScreen as mentioned on [Using with Ionic Framework | Capacitor Documentation](https://capacitor.ionicframework.com/docs/getting-started/with-ionic/) I get this warning in the console:

> common.js:295 Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator

when running npx cap serve  
is it possible to remove this or is it a bug in Ionic4 ?

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 22, 2018, 1:49pm UTC](https://forum.ionicframework.com/t/switching-to-capacitor/139286/2 "2018-08-22T13:49:52Z")

</div>

You can also uninstall @ionic-native/splashscreen and remove the code - then this message should be gone. You can manage the Splashscreen with Capacitor: [https://capacitor.ionicframework.com/docs/apis/splash-screen](https://capacitor.ionicframework.com/docs/apis/splash-screen)

---

<div class="post-metadata">

**Author:** ![developergeme](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@developergeme](https://forum.ionicframework.com/u/developergeme)\
**Post date:** [August 22, 2018, 2:17pm UTC](https://forum.ionicframework.com/t/switching-to-capacitor/139286/3 "2018-08-22T14:17:23Z")

</div>

> [@Sujan12](#):
>
> @ionic-native/splashscreen

You pointed me in the right direction, as it is not enough just to remove the plugin as stated on the Capacitor-website, I also need to remove the usage of the plugin from and app.component.ts, where I had these statements

```
this.platform.ready().then(() => {
  this.statusBar.styleDefault();
  this.splashScreen.hide();
});

```

I have now replaced that with:

> import {  
> Plugins,  
> StatusBarStyle,  
> } from ‘@capacitor/core’;
> 
> const { StatusBar } = Plugins;  
> const { SplashScreen } = Plugins;

and

```
this.platform.ready().then(() => {
  StatusBar.setStyle({
    style: StatusBarStyle.Light
  });
  SplashScreen.hide();
});

```

in app.component.ts

But I did not find a way to uninstall @ionic-native/splashscreen as it is not anywhere in my configuration

---

<div class="post-metadata">

**Author:** ![joshmorony](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/joshmorony/32/117695_2.png) [@joshmorony](https://forum.ionicframework.com/u/joshmorony)\
**Post date:** [August 22, 2018, 2:21pm UTC](https://forum.ionicframework.com/t/switching-to-capacitor/139286/4 "2018-08-22T14:21:47Z")

</div>

You should be able to just run `npm uninstall @ionic-native/splashscreen`, and you can also import both the StatusBar and SplashScreen in one line:

```auto
const { StatusBar, SplashScreen } = Plugins;

```

Make sure to run the Capacitor sync or update commands whenever you change plugins too 🙂

---

<div class="post-metadata">

**Author:** ![developergeme](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@developergeme](https://forum.ionicframework.com/u/developergeme)\
**Post date:** [August 22, 2018, 2:37pm UTC](https://forum.ionicframework.com/t/switching-to-capacitor/139286/5 "2018-08-22T14:37:08Z")

</div>

Looking in config.xml there are a loot of settings for SplashScreen

> \<preference name=“SplashMaintainAspectRatio” value=“true” /\>  
> \<preference name=“FadeSplashScreenDuration” value=“300” /\>  
> \<preference name=“SplashShowOnlyFirstTime” value=“false” /\>  
> \<preference name=“SplashScreen” value=“screen” /\>  
> \<preference name=“SplashScreenSpinnerColor” value=“white” /\>  
> \<preference name=“ShowSplashScreenSpinner” value=“true” /\>  
> \<preference name=“FadeSplashScreen” value=“true” /\>  
> \<preference name=“AutoHideSplashScreen” value=“false” /\>  
> \<preference name=“SplashScreenDelay” value=“60000” /\>  
> \<preference name=“orientation” value=“portrait” /\>  
> \<preference name=“SplashReloadOnOrientationChange” value=“true” /\>

Should they all just be removed, when switching to Capacitor?

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 22, 2018, 3:09pm UTC](https://forum.ionicframework.com/t/switching-to-capacitor/139286/6 "2018-08-22T15:09:14Z")

</div>

Those are not used by Capacitor, so yes.  
You might want to see if Capacitor’s SplashScreen recreates those all though.

---

<div class="post-metadata">

**Author:** ![developergeme](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@developergeme](https://forum.ionicframework.com/u/developergeme)\
**Post date:** [August 22, 2018, 3:14pm UTC](https://forum.ionicframework.com/t/switching-to-capacitor/139286/7 "2018-08-22T15:14:30Z")

</div>

Capacitor can be configured in capacitor.config.json, so I will try deleting and hope for the best 🙂

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:22pm UTC](https://forum.ionicframework.com/t/switching-to-capacitor/139286/8 "2021-07-19T21:22:48Z")

</div>


