Ionic Native: deviceready did not fire within 5000ms after adding cordova-plugin-file

Discussão em 'Angular' iniciado por Jay Godhani, Janeiro 22, 2025.

  1. Jay Godhani

    Jay Godhani Guest

    I have an ionic project requiring me to write files from the ionic into mobile devices. This can be achieved using Cordova's cordova-plugin-file and @ionic-native/file.

    When I add the plugin to my project it is throwing below error.

    Channel not fired: onFileSystemPathsReady
    Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.


    The error can be seen in the console as well. [​IMG]

    Ionic info:

    Ionic CLI : 7.2.0
    Ionic Framework : @ionic/angular 8.4.1
    @angular-devkit/build-angular : 16.2.15
    @angular-devkit/schematics : 16.2.15
    @angular/cli : 16.2.15
    @ionic/angular-toolkit : 11.0.1

    Cordova:
    Cordova CLI : 12.0.0 (cordova-lib@12.0.1)
    Cordova Platforms : android 9.1.0, ios 6.2.0
    cordova-plugin-file : version 5.0.0


    app.module.ts file:

    import { File } from "@ionic-native/file/ngx";

    @NgModule({
    declarations: [AppComponent, ModalPage, CustomIonicModalComponent],
    imports: [
    MatDialogModule,
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    FormRendererModule,
    FormsModule,
    BrowserAnimationsModule
    ],
    providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, MobileService, Keyboard, File],
    bootstrap: [AppComponent]
    })
    export class AppModule { }


    app.component.ts file:

    import { File } from '@ionic-native/file/ngx';

    @Component({
    selector: 'app-root',
    templateUrl: 'app.component.html',
    styleUrls: ['app.component.scss'],
    })

    export class AppComponent {
    constructor(private file: File) {}
    }


    Things I have tried to address this issue:

    • Re-installing all plugins and other dependencies
    • Clearing all the cache and rebuilding
    • Removing the files plugin to check if that is causing the issue (after removing plugin it is working as expected)
    • Upgrading and downgrading the file plugin

    Continue reading...

Compartilhe esta Página