Skip to content

App crashes after a while leaving it open and re-selecting it, using android #1614

@rosen-vladimirov

Description

@rosen-vladimirov

From @Daxito on February 19, 2016 4:4

So I just open a NS app and then I switch to other apps, then leave my cellphone alone for a while, then when I come back and try to "bring to the front" my App, it crashes with this error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yyy.yy/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property '_onAttached' of null
File: "/data/data/com.yyy.yy/files/app/tns_modules/ui/frame/frame.js, line: 414, column: 16

StackTrace:
Frame: function:'NativeActivity.onCreate', file:'/data/data/com.yyy.yy/files/app/tns_modules/ui/frame/frame.js', line: 414, column: 17

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2661)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

Caused by: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property '_onAttached' of null
File: "/data/data/com.yyy.yy/files/app/tns_modules/ui/frame/frame.js, line: 414, column: 16

StackTrace:
Frame: function:'NativeActivity.onCreate', file:'/data/data/com.yyy.yy/files/app/tns_modules/ui/frame/frame.js', line: 414, column: 17

at com.tns.Platform.callJSMethodNative(Native Method)
at com.tns.Platform.dispatchCallJSMethodNative(Platform.java:812)
at com.tns.Platform.callJSMethod(Platform.java:711)
at com.tns.Platform.callJSMethod(Platform.java:690)
at com.tns.Platform.callJSMethod(Platform.java:680)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:1574)
at android.app.Activity.performCreate(Activity.java:6221)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2614)
... 10 more

Copied from original issue: NativeScript/nativescript-cli#1512

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions