androidangularnativescript-angularnativescript-plugin

nativescript-ui-sidedrawer - Unable to start activity ComponentInfob Calling js method onCreate failed


what I doing wrong? This is my top html:

<RadSideDrawer>
  <Button ... ></Button>
    <StackLayout MainContent>
    <page-router-outlet></page-router-outlet>
  </StackLayout>

I have add this module to app.module.ts

...
import { NativeScriptUISideDrawerModule } from 'nativescript-ui-sidedrawer/angular'
@NgModule({
  imports: [
     NativeScriptUISideDrawerModule,

...

and implement on app.component.ts 3 method for working with driver

...
import { RadSideDrawerComponent } from "nativescript-ui-sidedrawer/angular";
import { RadSideDrawer } from "nativescript-ui-sidedrawer";

export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
    @ViewChild(RadSideDrawerComponent) drawerComponent: RadSideDrawerComponent;
    private drawerSub: Subscription;
    private drawer: RadSideDrawer;

    constructor(
      private uiService: UIService,
      private changeDetectionRef: ChangeDetectorRef,
      private vcRef: ViewContainerRef
    ) {}
...

All software version is fresh and latest for current moment. However I receive error:

 Project successfully built.
 Build time: 23.937 s.
 The build result is located at: ...\platforms\android\app\build\outputs\apk\debug\app-debug.apk
 Installing on device emulator-5554...
 Successfully installed on device with identifier 'emulator-5554'.
 Restarting application on device emulator-5554...
 ...
 AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.MyX/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
 AndroidRuntime: TypeError: Cannot read properties of undefined (reading 'nativeView')
 ...
 System.err: An uncaught Exception occurred on "main" thread.
 System.err: Unable to start activity ComponentInfo{org.nativescript.MyX/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
 System.err: TypeError: Cannot read properties of undefined (reading 'nativeView')

Solution

  • I found another drawer https://github.com/nativescript-community/ui-drawer and it working fine

    Drawer