NativeScript: NG2 tabView runtime errors / crashes with 'typeface' of null

Hello guys,

So i have been using the tab view in my new NS NG2 app and I have been running into issues I cant find resolves too. I currently have 2 pages that have tab views on them, each time i go to these pages i get a long list of errors like this.

W/ExifInterface(21871):         at com.tns.Runtime.callJSMethodNative(Native Met
hod)
W/ExifInterface(21871):         at com.tns.Runtime.dispatchCallJSMethodNative(Ru
ntime.java:1022)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethodImpl(Runtime.java
:907)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethod(Runtime.java:895
)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethod(Runtime.java:879
)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethod(Runtime.java:871
)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethodNative(Native Met
hod)
W/ExifInterface(21871):         at com.tns.Runtime.dispatchCallJSMethodNative(Ru
ntime.java:1022)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethodImpl(Runtime.java
:907)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethod(Runtime.java:895
)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethod(Runtime.java:879
)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethod(Runtime.java:871
)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethodNative(Native Met
hod)
W/ExifInterface(21871):         at com.tns.Runtime.dispatchCallJSMethodNative(Ru
ntime.java:1022)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethodImpl(Runtime.java
:907)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethod(Runtime.java:895
)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethod(Runtime.java:879
)
W/ExifInterface(21871):         at com.tns.Runtime.callJSMethod(Runtime.java:871
)

now if i navigate from one page then back to the tabs view page, i get cannot read ‘typeface’ of null.

I first thought it had to be something to do with the content of each tab so I made a blank page and used the demo tabView code to test this. This produced the same exact errors (http://docs.nativescript.org/angular/cookbook/tab-view-ng.html had to change the call for component from angular2 to @angular)

Did you verify this is a real problem by searching [Stack Overflow]

I was unable to find this issue anywhere else (some similar but not this exact one)

Which platform(s) does your issue occur on?

iAndroid (havent testing IOS yet)

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

  • CLI: 2.4.0
  • Cross-platform modules: 2.4.0
  • Runtime(s): android - 2.4.1 / IOS - 2.4.0
  • Plugin(s):
"nativescript-drop-down": "^1.3.3",
    "nativescript-loading-indicator": "^2.0.1",
    "nativescript-permissions": "^1.2.1",
    "nativescript-plugin-firebase": "3.8.4",
    "nativescript-telerik-ui": "1.4.1",
    "nativescript-toasty": "^1.1.0",

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

create a pge usign the code provided from the first example of this page http://docs.nativescript.org/angular/cookbook/tab-view-ng.html

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

just the code from the example. To save space on this post I will not repost it here

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 25 (9 by maintainers)

Most upvoted comments

Hello

I use nativescript with angular and I get exactly the same bug as this isssue referenced, but I reproduce it by an other way :

  • go to a page in the app that use tabview component
  • pause the app (go the android menu or other app)
  • resume the app
  • app crash like this isssue referenced

For informations, I only use the TabView component of Nativescript in a simple page, not barcodescanner plugin or others. And also, livesync or not, the app crash constantly on resuming on a page which includes a tabview

Please give us some news about this bug because it will be critical for my app

UPDATE: This fix has been released in tns-core-modules@2.5.2.

If you don’t mind me reopening this issue (with a reproduction path and proposed fix): simply clone this repo, navigate to the tab labeled ‘second’ and press the ‘scan upc’ button.

This will crash the app upon a scan result or using the cancel (back) button - with the same error message as reported here. Without the TabView everything works fine.

As you noticed it only occurred with LiveSync enabled, but with {N} 2.5.0 that’s default so that’s why this becomes a bit more urgent IMO.

The problem may originate from somewhere else, so this fix may not be the best, but at least I was able to get rid of it by adding if (!nativeValue) return; here.

Thanks, Eddy

investigation log.

(using your project) The errors do not appear on my lg g5, but they will on my lg g3. (on my project errors will appear with both)

my sample project will throw errors on both the lg g3 and the g5.

some dependencies are different however matching your versions to my project does not solve the issue.

using your app component code my demo app will SOMETIMES throw these errors, sometimes it wont.

after messing with some of the code, this issue may not be cause by the tab view, as i previously thought.

I decided to make a .apk for my app and install it that ways (instead of tns livesync android --watch)

Navigating through the pages with tabs in them does not cause a crash, This might be a livesync only issue?

tested this on multiple devices

Since the issue is not present when run outside of livesync, I will not be putting any more time towards fixing this. Thanks to everyone that helped me out. I hope this log helps someone else out in the future.

I am closing this issue