"Supplied parameters do not match any signatur of call target" when build ios


#1

Hello,

I got an error

 Supplied parameters do not match any signatur of call target
Failed to transpile Typescript

when building with ionic cordova build ios --prod.
According to the error message the error is here…
The aim is to use SqlLiteStorage on device and for Browser to use LocalStorage.

app.module.ts

export function createStorageProvider(platform: Platform, localStorage: LocalStorageProvider, sqlStorage: SqlLiteStorageProvider) {
  return new StorageProvider(platform, localStorage, sqlStorage);
}

providers: [
    LocalStorageProvider,
    SqlLiteStorageProvider,
    {
      provide: StorageProvider,
      useFactory: createStorageProvider,
      deps: [
        Platform, LocalStorageProvider, SqlLiteStorageProvider
      ]
    }
  ]

storageprovider.ts

@Injectable()
export class StorageProvider {
  public storage: any;

  constructor(private platform: Platform, private localStorage: LocalStorageProvider, private sqlLiteStorage: SqlLiteStorageProvider) {
    this.storage = this.platform.is('ios') ? sqlLiteStorage : localStorage;
  }
}