Providers cannot be resolved


#1

I have been having problems with providers/injections since version 2.0.0.
The error I keep getting is the following (with different providers, not only this one):

Uncaught Error:
Can’t resolve all parameters for LoginRedirectService: (App, ?, AlertController).

There seems to be a problem with resolving injections of my providers, even though they are all decorated with @Injectable.

one file

@Injectable()
export class LoginRedirectService {

    constructor(
        public app:App, 
        //another provider, needed within this one - this cannot be resolved
        public authService: AuthenticationService,
        public alert:AlertController
    )
//...
}

different file

@Injectable()
export class AuthenticationService {
    constructor(public dataService:DataService){
        //...
    }
}

//...

and so on.

I also have added all providers in the app.module.ts, in the order in which they have to be injected in:

//Ordered by dependencies, bottom is the most dependent on others
providers: [
    RssService,
    EmergencyEmailService,
    InAppBrowserService,
    ExternalBrowser,
    AppLauncherService,
    LauncherPlaner,
    LauncherSkype,
    ConnectivityService,
    MockRemoteDataService,
    SoniaMirthRemoteDataService,
    DataService,
    AuthenticationService,
    LoginRedirectService,
    NewsStreamService,
    SoniaBootstrapService
]

My project structure looks like this:

  • src
    • app
      • app.module.ts
      • app.component.ts
    • assets
    • pages
    • providers
      • sub-folders
  • package.json etc.

I have tried explicitly calling @Inject in the constructors of classes where they are needed, but no success either.

I am really out of ideas what to do and appreciate any help, thanks


#2

Hello, i have the same probleme, did you found any solution ?