Cannot find module "ionic-native"
The package ionic-native
doesn't exist anymore. The modules are now in its own package:
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
You need to remove "ionic-native": "^3.5.0"
from your package.json
and after that run npm i
.
You need to use all your native plugins as providers
as shown below.
app.component.ts
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
});
}
app.module.ts
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
@NgModule({
providers: [
StatusBar,
SplashScreen,
]
})
export class AppModule { }
You can read more about this new implementation on official doc here.