Skip to content

Android APP_INITIALIZER Cannot read property 'nativeView' of undefined #2289

Open
@standevo

Description

@standevo

Environment

  • NS: 7.0.11
  • Android: 10
  • Angular CLI: 10.2.0
  • Angular: 10.1.6

Describe the bug
Using APP_INITIALIZER on Android I run into the issue (on IOS works fine):
JS: ERROR TypeError: Cannot read property 'nativeView' of undefined

To Reproduce

  • tns create myAPP
  • Select angular & side-drawer template

Add in app.module.ts

providers: [
        {
            provide: APP_INITIALIZER,
            useFactory: () => {
                return () =>
                    new Promise((resolve) => {
                        setTimeout(() => {
                            resolve();
                        }, 1000);
                    });
            },
            multi: true,
        },
    ]

main.ts

platformNativeScriptDynamic({
    async:true,
}).bootstrapModule(AppModule);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions