Runtime Error No provider for ApplicationInitStatus!

It works

imports: [
    IonicModule.forRoot(MyApp),
    BrowserModule
  ]

Finally.
Thanks!!!

5 Likes

Don’t forget to also import HttpModule if you are using Http.

1 Like

Thank you for your help, @rapropos!

Runtime Error
HttpModule is not defined

BTW @rapropos do you know what could happen with this error

ionic run ios --device

 ** BUILD SUCCEEDED **


xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH


Error: Error code 72 for command: xcrun with args: -sdk,iphoneos,PackageApplication,-v,/.../ionic-new/platforms/ios/build/device/ionic-new.app,-o,/.../ionic-new/platforms/ios/build/device/ionic-new.ipa

Blind guess, but maybe you haven’t installed ios-deploy or whatever that thing is called. I never use ionic run, so not sure. I always just run out of Xcode.

It’s installed

$ ionic info

Your system information:

Cordova CLI: 6.5.0 
Ionic Framework Version: 3.0.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: 1.9.1 
ios-sim version: 5.0.13 
OS: macOS Sierra
Node Version: v6.10.2
Xcode version: Xcode 8.3 Build version 8E162

I read that maybe it could be compatibility with Xcode 8.3 and cordova, but not idea

Looks that way. I guess “PackageApplication” got nuked.

1 Like

What version of cordova-ios do you have?

$ ionic platform ls

If it’s older than 4.3, perhaps this PR fixed it, and upgrading your platform will fix things.

$ ionic platform ls
Installed platforms:
  ios 4.1.1

This is probably happens on upgrading your previous Ionic Project to its Latest Version :


To solve this,

Add BrowserModule in app.module.ts file.

  • import BrowserModule first:

    import { BrowserModule } from ‘@angular/platform-browser’;

  • Update imports inside @NgModule (i.e. inject BrowserModule here):

    imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp)
    ],

Remember That: If you are using Http, import the HttpModule in your app/app.module.ts file:
import { HttpModule } from ‘@angular/http’;

Also add HttpModule into imports under @NgModule

– All the best :+1:

4 Likes

where did you add this?

imports: [
IonicModule.forRoot(MyApp),
BrowserModule
]

app.module.ts i guess.

You have to do this for iOnic 3

Already add this

imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],

but I have this error now

Runtime Error
Uncaught (in promise): ReferenceError: WikitudePlugin is not defined

anyone?

import { BrowserModule } from ‘@angular//platform-browser’;
import { HttpModule } from ‘@angular/http’;

imports: [
BrowserModule,
HttpModule,
IonicModule.forRoot(MyApp)
],

BrowserModule is missing in your app. you need to import browser module

1 Like

@rapropos - just an off topic question but an important one for me…

How did you figure out that it is related to BrowserModule?

Your knowledge and patience to help everybody is awesome!! A true Guru!

Thanks! :slight_smile:

1 Like

The comment suggesting that OP check the upgrade guide made me think it might have been something that changed between versions. I used GitHub’s search feature to look for ApplicationInitStatus in both the Ionic and Angular repositories. Found it in Angular’s core, thought of the need for importing BrowserModule being a relatively new requirement, opened up my trusty sandbox project, took the BrowserModule import out of its app module, tried to run, and replicated OP’s error.

5 Likes

@rapropos - thanks for penning your thought process down, appreciated! :thumbsup:

I tried to do follow the same but even though I have imported BrowserModule and included in

imports: [
IonicModule.forRoot(MyApp),BrowserModule
],

still it gives me the same error.
Am I missing something.

Followed the Ionic 3 migration guide, added BrowserModule as said in multiple replies.

At first I did not see any changes.

Then I remembered that I had uncommented the service-worker, and so when I updated the page, it was reloading with the same error from the service-worker’s cache… so I hit hard reload and finally saw my app fixed!

Hope this will help someone.