Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.

An uncaught Exception occurred on "main" thread #133

Open
tony2u opened this issue Aug 8, 2018 · 0 comments
Open

An uncaught Exception occurred on "main" thread #133

tony2u opened this issue Aug 8, 2018 · 0 comments

Comments

@tony2u
Copy link

tony2u commented Aug 8, 2018

Make sure to check the existing issues in this repository

Yes

If there is no issue for your problem, tell us about it

An uncaught Exception occurred on "main" thread.

Which platform(s) does your issue occur on?

Android 4.4.2,6.0.1,7.1.1

Please, provide the following version numbers that your issue occurs with:

  • CLI: (4.2.0)
  • Cross-platform modules: (3.4.0)
  • Runtime(s): (3.4.1)
  • Plugin(s): (
    "dependencies": {
    "nativescript-gif": "^3.1.1",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-vue": "^0.1.1",
    "tns-core-modules": "^3.0.0",
    "vue-router": "^2.4.0"
    },
    "devDependencies": {
    "babel-traverse": "6.24.1",
    "babel-types": "6.24.1",
    "babylon": "6.16.1",
    "lazy": "1.0.11",
    "nativescript-dev-android-snapshot": "^0.."
    }
    )

Please, tell us how to recreate the issue in as much detail as possible.

I have tested a simple movie-brief app from github: https://github.com/HolyZheng/nativescript-vue-build-a-movie-brief-app

Whenever my app turn off and run again, it has crashed and report:

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to resume activity {org.nativescript.myapp/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreateView failed

Error: View already has a parent. View: Page(13) Parent: Frame(14)
File: "file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js, line: 343, column: 12

StackTrace:
Frame: function:'ViewBase._addView', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 343, column: 19
Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 504, column: 24
Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/ui/frame/fragment.js', line: 27, column: 38

at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3230)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3308)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2587)
at android.app.ActivityThread.access$1200(ActivityThread.java:163)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1441)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException:
Calling js method onCreateView failed

Error: View already has a parent. View: Page(13) Parent: Frame(14)
File: "file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js, line: 343, column: 12

StackTrace:
Frame: function:'ViewBase._addView', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 343, column: 19
Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 504, column: 24
Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/ui/frame/fragment.js', line: 27, column: 38

at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:957)
at com.tns.Runtime.callJSMethod(Runtime.java:941)
at com.tns.Runtime.callJSMethod(Runtime.java:933)
at com.tns.FragmentClass.onCreateView(FragmentClass.java:40)
at android.app.Fragment.performCreateView(Fragment.java:2223)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
at android.app.BackStackRecord.run(BackStackRecord.java:793)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535)
at android.app.FragmentController.execPendingActions(FragmentController.java:325)
at android.app.Activity.performResume(Activity.java:6394)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3219)
... 10 more

Is there any code involved?

Yes, the all codes can be gitted clone from github: https://github.com/HolyZheng/nativescript-vue-build-a-movie-brief-app

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant