question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App crash if Modal Page is opened

See original GitHub issue

If some XML or CSS file is change and in app Modal Page is opened (was opened on touch event), app crash during LiveSync process.

System.err: com.tns.NativeScriptException: 
System.err: Calling js method onDismiss failed
System.err: 
System.err: TypeError: Cannot read property 'setOnTouchListener' of null
System.err: File: "file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view/view.js, line: 213, column: 37
System.err: 
System.err: StackTrace: 
System.err: 	Frame: function:'View.onUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 213, column: 38
System.err: 	Frame: function:'', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 315, column: 92
System.err: 	Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 304, column: 9
System.err: 	Frame: function:'ViewBase.callUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 315, column: 14
System.err: 	Frame: function:'ViewBase.unloadView', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 444, column: 18
System.err: 	Frame: function:'', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 246, column: 19
System.err: 	Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
System.err: 	Frame: function:'ViewCommon.eachChild', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14
System.err: 	Frame: function:'ViewBase.onUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 245, column: 14
System.err: 	Frame: function:'View.onUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 218, column: 37
System.err: 	Frame: function:'', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 315, column: 92
System.err: 	Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 304, column: 9
System.err: 	Frame: function:'ViewBase.callUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 315, column: 14
System.err: 	Frame: function:'ViewBase.unloadView', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 444, column: 18
System.err: 	Frame: function:'', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 246, column: 19
System.err: 	Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
System.err: 	Frame: function:'ViewCommon.eachChild', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14
System.err: 	Frame: function:'ViewBase.onUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 245, column: 14
System.err: 	Frame: function:'View.onUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 218, column: 37
System.err: 	Frame: function:'', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 315, column: 92
System.err: 	Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 304, column: 9
System.err: 	Frame: function:'ViewBase.callUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 315, column: 14
System.err: 	Frame: function:'ViewBase.unloadView', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 444, column: 18
System.err: 	Frame: function:'', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 246, column: 19
System.err: 	Frame: function:'ContentView.eachChildView', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13
System.err: 	Frame: function:'PageBase.eachChildView', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 120, column: 40
System.err: 	Frame: function:'ViewCommon.eachChild', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14
System.err: 	Frame: function:'ViewBase.onUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 245, column: 14
System.err: 	Frame: function:'View.onUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 218, column: 37
System.err: 	Frame: function:'', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 315, column: 92
System.err: 	Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 304, column: 9
System.err: 	Frame: function:'ViewBase.callUnloaded', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 315, column: 14
System.err: 	Frame: function:'DialogFragmentImpl.onDismiss', file:'file:///data/data/com.test/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 137, column: 23
System.err: 
System.err: 	at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: 	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101)
System.err: 	at com.tns.Runtime.callJSMethodImpl(Runtime.java:983)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:970)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:954)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:946)
System.err: 	at com.tns.gen.android.app.DialogFragment_view_84_32_DialogFragmentImpl.onDismiss(DialogFragment_view_84_32_DialogFragmentImpl.java:36)
System.err: 	at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1477)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:102)
System.err: 	at android.os.Looper.loop(Looper.java:154)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6776)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
ActivityManager: Process com.test (pid 20808) has died(61,541)
ActivityManager: cleanUpApplicationRecord -- 20808
$tns --version
4.1.2

from package.json:

"nativescript": {
    "id": "com.test",
    "tns-android": {
      "version": "4.1.3"
    }
  }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
surducommented, Dec 14, 2018

We managed to find a scenario on how to reproduce it:

  • open a modal
  • put the app in background
  • get a notification from Firebase
  • tap the notification, which will open the app
  • the app will crash with the above error

The crash only happens when the app is reopened with the notification, not if you tap the app icon or switch to the app. This make me believe this is related to this other issue, because that issue will reproduce when you tap the “Open” button but also when you open the app via a Firebase notification.

I’ve tried with a app-created notifications, and it seems it’s not the same. I’m guessing the Firebase notification are created by the OS and in a different way than the notifications the app creates.

1reaction
mayureshjadhavcommented, Nov 9, 2018

After digging I found that the issue was in “nativescript-dev-webpack” plugin. If anyone is facing the issue, please update the plugin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash with Modal Window and NStatu… - Apple Developer
Click on the status bar icon opening the menu. Select the menu item to show the modal window. While the modal window is...
Read more >
android app crashes while opening modal second time #290
I can open and close the Modal 1 time, but the second time the app crashes without any error or other information. With...
Read more >
Modal Popup causes access to crash - Stack Overflow
When I incidentally open my form in "form view" instead of "design view" It causes a VB script error (which is normal, because...
Read more >
Navigating away fom modal screen causes a crash. - MSDN
When I tap a button on that page, a modal window (FooModal.xaml) should load. I want this modal page to act like a...
Read more >
SAP AppGyver Changelog
Fixed an issue where on built standalone Android apps, opening page with dropdown would freeze/crash the app (requires component update from the marketplace!)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found