Thanks and for those who face the similar issue kindly check your dependency.In my case I didn’t add the network ionic plugin in my app.module.ts providers.
@baratacom Are you using ionic angular ? If so then in your app.module.ts there is something called providers section where you have to add the ionic plugins you have used in your app.In my case i used something called network to check the network availability so I have added network to that providers in app.module.ts.Hope this helps.