Open
Description
Issue Description
When we are integrating the NativeScript (angular) App into our existing Native Android app, while navigating from Native screen to NativeScript screen first time navigation is working fine. But when we come back to Native screen and navigate again to NativeScript part, the app is crashing.
The same issue happening even with the sample Hello world app/Drawer app.
PS: With or without embedded flag the app is crashing. However we specifically needs embedded to be true.
Reproduction
- Integrate latest NS app to Native Android App
- Launch the app
- Navigate from Native screen to NativeScript Screen
- Press back and come back to Native Screen
- Repeat step 3
- App is crashing
Relevant log output (if applicable)
2023-07-12 18:51:06.976 3455-3455 AndroidRuntime com.example.nsthirdapp E FATAL EXCEPTION: main
Process: com.example.nsthirdapp, PID: 3455
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.nsthirdapp/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
TypeError: Cannot read properties of undefined (reading 'cssClasses')
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3645)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: com.tns.NativeScriptException: Calling js method onCreate failed
TypeError: Cannot read properties of undefined (reading 'cssClasses')
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188)
at com.tns.Runtime.callJSMethod(Runtime.java:1175)
at com.tns.Runtime.callJSMethod(Runtime.java:1153)
at com.tns.Runtime.callJSMethod(Runtime.java:1149)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:57)
at android.app.Activity.performCreate(Activity.java:8305)
at android.app.Activity.performCreate(Activity.java:8284)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
... 12 more
Environment
No response
Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project's Code of Conduct