Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.tns.NativeScriptException - MetaData cannot be opened. #1546

Closed
shiv19 opened this issue Dec 1, 2019 · 80 comments · Fixed by #1621
Closed

com.tns.NativeScriptException - MetaData cannot be opened. #1546

shiv19 opened this issue Dec 1, 2019 · 80 comments · Fixed by #1621
Assignees

Comments

@shiv19
Copy link
Member

shiv19 commented Dec 1, 2019

Been seeing this crash report at an alarming rate lately
image
image
image

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6214)
  at android.app.ActivityThread.access$1200 (ActivityThread.java:236)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1784)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7037)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)
Caused by: com.tns.NativeScriptException: 
  at com.tns.Runtime.initNativeScript (Native Method)
  at com.tns.Runtime.init (Runtime.java:627)
  at com.tns.Runtime.init (Runtime.java:601)
  at com.tns.Runtime.initRuntime (Runtime.java:591)
  at com.tns.Runtime.initializeRuntimeWithConfiguration (Runtime.java:566)
  at com.tns.RuntimeHelper.initRuntime (RuntimeHelper.java:163)
  at com.tns.NativeScriptApplication.onCreate (NativeScriptApplication.java:20)
  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1154)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6209)
@farfromrefug
Copy link
Contributor

Duplicate of this issue i think NativeScript/NativeScript#8037 and it should contain a fix too

@shiv19
Copy link
Member Author

shiv19 commented Dec 2, 2019

@farfromrefug what I reported is different from what @maxorlovsky reported here.

@farfromrefug
Copy link
Contributor

@shiv19 ok sorry looked at the last message! Sorry

@maxorlovsky
Copy link

deleted mine, to not confuse anyone else

@Jmchemama
Copy link

I have same issue.

@anmaitrannguyen
Copy link

I have the same issues. The crash rate is at alarm rate.

@vtrifonov
Copy link
Contributor

Do you use crashlytics or something similar, so that we can get more information about the exception as the message is missing here and we don't know what is the exact error?

@anmaitrannguyen
Copy link

We does have Crashlytics. But these crash does not display on Crashlytics, these crash is new, after we upgrade the app from Nativescript 6.1.2 to Nativescript 6.3.0. Only appear on Google Play Console. Some of our user report the app crash at the first time after upgrade, but working fine after that. Not sure this can give us any hint.
java.lang.RuntimeException: at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6276) at android.app.ActivityThread.access$1200 (ActivityThread.java:238) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1794) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loop (Looper.java:214) at android.app.ActivityThread.main (ActivityThread.java:7099) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965) Caused by: com.tns.NativeScriptException: at com.tns.Runtime.initNativeScript (Native Method) at com.tns.Runtime.init (Runtime.java:627) at com.tns.Runtime.init (Runtime.java:601) at com.tns.Runtime.initRuntime (Runtime.java:591) at com.tns.Runtime.initializeRuntimeWithConfiguration (Runtime.java:566) at com.tns.RuntimeHelper.initRuntime (RuntimeHelper.java:163) at com.tns.NativeScriptApplication.onCreate (NativeScriptApplication.java:19) at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1158) at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6271)

@jpierront
Copy link

jpierront commented Jan 25, 2020

Exactly the same for me.
It seems that it appeared when switching to NativeScript 6.2. (But I didn't change only that dependency with this update)
This seems to happen only on Android 9 and 10.

@jessorlisa
Copy link

Was anyone able to solve that?

@7ammer
Copy link

7ammer commented Apr 26, 2020

Getting the same error stack after updating last week. 6,491 reports so far! 😬

Our project jumped from:
"tns-core-modules": "^6.0.0" to "^6.5.1",
"tns-android": "6.0.0" to "6.5.0"
"tns-ios": "6.0.1" to "6.5.0"

Crashalytics is not reporting these errors. In-fact the crash rate on Crashlytics went down!

@7ammer
Copy link

7ammer commented Apr 27, 2020

Perhaps it maybe helpful if we provided more detailed info on our projects?

  • "tns --version": "6.5.0"
  • "tns-core-modules": "6.5.1"
  • framework: "vue"
  • tns-ios: "6.5.0"
  • tns-android: "6.5.0"
"dependencies": {
  "@vue/devtools": "^5.0.6",
  "nativescript-advanced-webview": "^3.0.2",
  "nativescript-animated-circle": "^1.2.0",
  "nativescript-datetimepicker": "^1.2.1",
  "nativescript-dev-appium": "^6.1.3",
  "nativescript-local-notifications": "^4.1.5",
  "nativescript-localstorage": "^2.0.0",
  "nativescript-permissions": "^1.2.3",
  "nativescript-plugin-firebase": "^10.3.0",
  "nativescript-social-share": "^1.5.2",
  "nativescript-socketio": "^3.2.1",
  "nativescript-statusbar": "^5.0.0",
  "nativescript-toasty": "^3.0.0-alpha.2",
  "nativescript-vue": "^2.6.0",
  "nativescript-vue-devtools": "^1.2.0",
  "nativescript-webview-interface": "^1.4.3",
  "tns-core-modules": "^6.5.1",
  "url-parse": "^1.4.7",
  "util-inspect": "^0.1.8"
},
"devDependencies": {
  "@babel/core": "^7.0.0",
  "@babel/preset-env": "^7.0.0",
  "@types/chai": "~4.1.7",
  "@types/mocha": "~5.2.5",
  "@types/node": "^12.12.16",
  "babel-loader": "^8.0.2",
  "chai": "~4.1.2",
  "mocha": "~5.2.0",
  "mocha-junit-reporter": "~1.18.0",
  "mocha-multi": "~1.0.1",
  "mochawesome": "~3.1.2",
  "nativescript-dev-webpack": "^1.0.0",
  "nativescript-vue-template-compiler": "^2.5.0",
  "nativescript-worker-loader": "^0.11.0",
  "node-sass": "^4.9.2",
  "tns-platform-declarations": "^6.0.0",
  "typescript": "^3.2.4",
  "vue": "^2.5.22",
  "vue-loader": "^15.4.0"
}

@NathanaelA

This comment was marked as abuse.

@NathanaelA

This comment was marked as abuse.

@saschaarthur
Copy link
Contributor

Hello,

After further investigation we were able to reproduce it.

Last stable version is 6.1.2.
On all versions above you can reproduce it following:

  • Open your app (version> 6.1.2).
  • run "adb logcat --buffer=crash" (stacktrace logging, optional)
  • Reboot your device
  • run "adb logcat --buffer=crash" (stacktrace logging, optional)

we were able to fetch a full stacktrace like this with following error message:

04-30 12:12:38.665  3354  3354 E AndroidRuntime: FATAL EXCEPTION: main
04-30 12:12:38.665  3354  3354 E AndroidRuntime: Process: com.xxx.mobile, PID: 3354
04-30 12:12:38.665  3354  3354 E AndroidRuntime: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: metadata folder couldn't be opened!
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6079)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at android.app.ActivityThread.access$1300(ActivityThread.java:207)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1758)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:193)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6898)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
04-30 12:12:38.665  3354  3354 E AndroidRuntime: Caused by: com.tns.NativeScriptException: metadata folder couldn't be opened!
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at com.tns.Runtime.initNativeScript(Native Method)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at com.tns.Runtime.init(Runtime.java:627)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at com.tns.Runtime.init(Runtime.java:601)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at com.tns.Runtime.initRuntime(Runtime.java:591)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at com.tns.Runtime.initializeRuntimeWithConfiguration(Runtime.java:566)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at com.tns.RuntimeHelper.initRuntime(RuntimeHelper.java:163)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1165)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6074)
04-30 12:12:38.665  3354  3354 E AndroidRuntime:        ... 8 more

Why is google not reporting the full message? If this is known, nativescript should maybe implement subclasses of the NativeScriptException, to identify further whats the cause of issues like this..

Also we had following crash on nativescript 6.1.2 (maybe off topic, maybe related, but it happened only once and its not reproducable):

04-30 12:52:18.004  7977  7977 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x572 in tid 7977 (om.xxx.mobile), pid 7977 (om.xxx.mobile)
04-30 12:52:18.109  8026  8026 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-30 12:52:18.109  8026  8026 F DEBUG   : Build fingerprint: 'samsung/d2seea/d2s:10/QP1A.190711.020/N975FXXU3CTC9:user/release-keys'
04-30 12:52:18.110  8026  8026 F DEBUG   : Revision: '24'
04-30 12:52:18.110  8026  8026 F DEBUG   : ABI: 'arm64'
04-30 12:52:18.111  8026  8026 F DEBUG   : Timestamp: 2020-04-30 12:52:18+0200
04-30 12:52:18.111  8026  8026 F DEBUG   : pid: 7977, tid: 7977, name: om.xxx.mobile  >>> com.xxx.mobile <<<
04-30 12:52:18.111  8026  8026 F DEBUG   : uid: 10390
04-30 12:52:18.111  8026  8026 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x572
04-30 12:52:18.111  8026  8026 F DEBUG   : Cause: null pointer dereference
04-30 12:52:18.111  8026  8026 F DEBUG   :     x0  00000000d2801168  x1  0000000000000572  x2  0000007fe6bfa300  x3  0000000000000571
04-30 12:52:18.111  8026  8026 F DEBUG   :     x4  0000000000000000  x5  0000000000000000  x6  0000007910a89200  x7  0000007910a89000
04-30 12:52:18.111  8026  8026 F DEBUG   :     x8  0000000000000000  x9  0000000000000001  x10 0000000000004001  x11 0000000000000000
04-30 12:52:18.111  8026  8026 F DEBUG   :     x12 0000000000000000  x13 0000000000000000  x14 ffffffffffffffff  x15 00000000000000e0
04-30 12:52:18.111  8026  8026 F DEBUG   :     x16 0000007a020c6160  x17 0000007a08bfb3f8  x18 0000007a082fc000  x19 0000007fe6bfac10
04-30 12:52:18.111  8026  8026 F DEBUG   :     x20 0000007fe6bfa850  x21 0000000000000000  x22 0000007fe6bfac10  x23 00000000ffffffff
04-30 12:52:18.111  8026  8026 F DEBUG   :     x24 00000079118415c8  x25 0000000000000000  x26 0000007a077700b0  x27 0000000000000001
04-30 12:52:18.111  8026  8026 F DEBUG   :     x28 0000007fe6bfcb20  x29 0000007fe6bfa330
04-30 12:52:18.111  8026  8026 F DEBUG   :     sp  0000007fe6bfa330  lr  000000791173a6f4  pc  000000791173a708
04-30 12:52:18.115  8026  8026 F DEBUG   :
04-30 12:52:18.115  8026  8026 F DEBUG   : backtrace:
04-30 12:52:18.115  8026  8026 F DEBUG   :       #00 pc 0000000000cb1708  /data/app/com.xxx.mobile-XVZOEoQhsGUe5MfcemPIxw==/lib/arm64/libNativeScript.so (BuildId: c32f555a4cc76af68f68df53be8a35d41f5938eb)
04-30 12:52:18.115  8026  8026 F DEBUG   :       #01 pc 0000000000cb26b0  /data/app/com.xxx.mobile-XVZOEoQhsGUe5MfcemPIxw==/lib/arm64/libNativeScript.so (_Unwind_RaiseException+112) (BuildId: c32f555a4cc76af68f68df53be8a35d41f5938eb)
04-30 12:52:18.115  8026  8026 F DEBUG   :       #02 pc 00000000008c69ac  /data/app/com.xxx.mobile-XVZOEoQhsGUe5MfcemPIxw==/lib/arm64/libNativeScript.so (__cxa_throw+112) (BuildId: c32f555a4cc76af68f68df53be8a35d41f5938eb)
04-30 12:52:18.115  8026  8026 F DEBUG   :       #03 pc 000000000028e7e4  /data/app/com.xxx.mobile-XVZOEoQhsGUe5MfcemPIxw==/lib/arm64/libNativeScript.so (BuildId: c32f555a4cc76af68f68df53be8a35d41f5938eb)
04-30 12:52:18.115  8026  8026 F DEBUG   :       #04 pc 0000000000000572  <unknown>

@NathanaelA

This comment was marked as abuse.

@NathanaelA

This comment was marked as abuse.

@saschaarthur
Copy link
Contributor

saschaarthur commented May 1, 2020

Its happens when the system is shutting down (and the app is open), not when its booting up.

We reproduced it with multiple real devices.

Yeah everything 6.2 and higher is affected

@NathanaelA

This comment was marked as abuse.

@jessorlisa
Copy link

@NathanaelA @saschaarthur

I have been able to narrow it further down. I compared @7ammer's plugin list with our own, the only overlapping plugins are:

  • nativescript-local-notifications
  • nativescript-plugin-firebase

The issue arises with nativescript-local-notifications. To reproduce please follow the steps below:

tns create testcrash --js
cd testcrash
tns plugin add nativescript-local-notifications
tns run android
adb logcat --buffer=crash

Restart device

adb logcat --buffer=crash

You should see the reported crash. It happens with nativescript >= 6.2.

@ALL Are you also using the nativescript-local-notifications plugin?

@jessorlisa
Copy link

jessorlisa commented May 2, 2020

Why is google not reporting the full message? If this is known, nativescript should maybe implement subclasses of the NativeScriptException, to identify further whats the cause of issues like this..

As @saschaarthur mentioned this would be really helpful 👍

@saschaarthur
Copy link
Contributor

saschaarthur commented May 2, 2020

How frequently do you see a crash?

every reboot

Do you have to have a version released from the Play Store, or can it be deployed to the device
from the CLI?

deployed to device via CLI

Can it be a debug version, or are you testing only signed apps?

Debug version is enough

As @jessorlisa wrote already its prob the plugin we also installed, try her commands to reproduce it.

@NathanaelA

This comment was marked as abuse.

@shiv19
Copy link
Member Author

shiv19 commented May 2, 2020

@NathanaelA can you please send us a zip file of your testcrash app so that we can see how you're using the local notifications plugin? 🤔

@NathanaelA

This comment was marked as abuse.

@jessorlisa
Copy link

I have been able to reproduce it on a Pixel 4, latest Android 10 version.
Sadly it does not seem to be happening on any emulator I have tested.

@jessorlisa
Copy link

However, in case actual notifications are an issue;

Notifications themself are not an issue. It is enough to add the plugin via tns plugin add nativescript-local-notifications - without any implementation.

@saschaarthur
Copy link
Contributor

saschaarthur commented May 3, 2020

Sorry thats very odd, we never tried the emulator and it seems we unluckely tested on all devices which were affected.
We didnt saw a pattern (and still dont see any) but it seems theres is one..?

Heres a List of affected devices we collected so far:

grafik

We tested mostly one OnePlus5T and Note 10 (fully updated).
Maybe its also related to device settings? Is there a possibility of a settings dump we could provide you?

Could you please also explain what 'Richard' did (link to commit?) , and who he is here? Maybe he can join the Thread as well?..

@7ammer
Copy link

7ammer commented May 3, 2020

Just tried the crash steps on a Oneplus6:

tns create crashtest --js
cd crashtest
tns plugin add nativescript-local-notifications
tns run android (not needed if app is already on device)
adb logcat --buffer=crash (not needed but can be useful)
[REBOOT]
adb logcat --buffer=crash (see result below)
[13:09:02] ~ 🤜 adb logcat --buffer=crash
05-03 13:09:42.492  3208  3208 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 3208 (init), pid 3208 (init)
05-03 13:09:42.540  3208  3208 F libc    : crash_dump helper failed to exec
05-03 13:09:44.236  3490  3490 E AndroidRuntime: FATAL EXCEPTION: main
05-03 13:09:44.236  3490  3490 E AndroidRuntime: Process: org.nativescript.crashtest, PID: 3490
05-03 13:09:44.236  3490  3490 E AndroidRuntime: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: metadata folder couldn't be opened!
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6652)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at android.app.ActivityThread.access$1600(ActivityThread.java:231)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1952)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:107)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:214)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7682)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: Caused by: com.tns.NativeScriptException: metadata folder couldn't be opened!
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at com.tns.Runtime.initNativeScript(Native Method)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at com.tns.Runtime.init(Runtime.java:627)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at com.tns.Runtime.init(Runtime.java:601)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at com.tns.Runtime.initRuntime(Runtime.java:591)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at com.tns.Runtime.initializeRuntimeWithConfiguration(Runtime.java:566)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at com.tns.RuntimeHelper.initRuntime(RuntimeHelper.java:163)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1197)
05-03 13:09:44.236  3490  3490 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6647)

@Peterf89
Copy link

Any news or ideas how to fix/get around this issue?

@NathanaelA

This comment was marked as abuse.

@NathanaelA NathanaelA changed the title com.tns.NativeScriptException com.tns.NativeScriptException - MetaData cannot be opened. May 30, 2020
@Peterf89
Copy link

Peterf89 commented May 30, 2020

java.lang.RuntimeException: at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6465) at android.app.ActivityThread.access$1300 (ActivityThread.java:219) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1859) at android.os.Handler.dispatchMessage (Handler.java:107) at android.os.Looper.loop (Looper.java:214) at android.app.ActivityThread.main (ActivityThread.java:7356) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:930) Caused by: com.tns.NativeScriptException: at com.tns.Runtime.initNativeScript (Native Method) at com.tns.Runtime.init (Runtime.java:627) at com.tns.Runtime.init (Runtime.java:601) at com.tns.Runtime.initRuntime (Runtime.java:591) at com.tns.Runtime.initializeRuntimeWithConfiguration (Runtime.java:566) at com.tns.RuntimeHelper.initRuntime (RuntimeHelper.java:163) at com.tns.NativeScriptApplication.onCreate (NativeScriptApplication.java:19) at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1189) at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6460)

This is from the Play Console. And yes, my latest production release is the first to include Local-Notifications. I haven't seen these errors before.

And this is the list of devices:

Galaxy A40 (a40) 11 28,9%
Pixel 2 (walleye) 7 18,4%
Galaxy S10e (beyond0) 5 13,2%
OnePlus 7 Pro (OnePlus7Pro) 5 13,2%
OnePlus 6 (OnePlus6) 3 7,9%
Galaxy S10 (beyond1) 3 7,9%
Galaxy A30 (a30) 2 5,3%
Galaxy Note10+ (d2s) 1 2,6%
OnePlus6T (OnePlus6T)

@7ammer
Copy link

7ammer commented Jun 9, 2020

Thank you @NathanaelA for looking into this :)

I'm curious to know if there has been any progress. Did you manage to replicate the issue on the pixel phone you ordered?

@7ammer
Copy link

7ammer commented Jun 9, 2020

I've just taken another look at all my crash reports after making a few updates and have noticed this new error. It has only happened twice in comparison to the other error but it looks very similar as it follows the same/similar stack trace and mentions ReferenceError: __metadata is not defined.

Google Pixel 2 (walleye), 3840MB RAM, Android 10
Report 1 of 2

java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function 
ReferenceError: __metadata is not defined
File: (file:///data/data/com.prayer247.lectio365/files/app/vendor.js:1:1364427)
(file
at (file:///data/data/com.prayer247.lectio365/files/app/vendor.js:1:1364546)
at __webpack_require__(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:686)
at (file:///data/data/com.prayer247.lectio365/files/app/vendor.js:1:1347819)
at __webpack_require__(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:686)
at (file:///data/data/com.prayer247.lectio365/files/app/bundle.js:1:44455)
at __webpack_require__(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:686)
at (file:///data/data/com.prayer247.lectio365/files/app/bundle.js:1:44255)
at __webpack_require__(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:686)
at (file:///data/data/com.prayer247.lectio365/files/app/bundle.js:1:236319)
at __webpack_require__(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:686)
at (file:///data/data/com.prayer247.lectio365/files/app/bundle.js:1:69604)
at __webpack_require__(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:686)
at (file:///data/data/com.prayer247.lectio365/files/app/bundle.js:1:16648)
at __webpack_require__(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:686)
at (file:///data/data/com.prayer247.lectio365/files/app/bundle.js:1:93079)
at (file:///data/data/com.prayer247.lectio365/files/app/bundle.js:1:94617)
at __webpack_require__(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:686)
at checkDeferredModules(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:508)
at webpackJsonpCallback(file:///data/data/com.prayer247.lectio365/files/app/runtime.js:1:331)
at (file:///data/data/com.prayer247.lectio365/files/app/bundle.js:1:169)
  at .require (1:266)
  at .ReferenceError
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6465)
  at android.app.ActivityThread.access$1300 (ActivityThread.java:219)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1859)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7356)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:930)
  at .__webpack_require__
  at .__webpack_require__
  at .__webpack_require__
  at .__webpack_require__
  at .__webpack_require__
  at .__webpack_require__
  at .__webpack_require__
  at .__webpack_require__
  at .checkDeferredModules
  at .webpackJsonpCallback
  at .require (1:266)
  at .ReferenceError
  at com.tns.Runtime.runModule (Native Method)
  at com.tns.Runtime.runModule (Runtime.java:674)
  at com.tns.Runtime.run (Runtime.java:666)
  at com.tns.NativeScriptApplication.onCreate (NativeScriptApplication.java:21)
  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1189)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6460)

@Peterf89
Copy link

Peterf89 commented Jun 9, 2020

I got rid of the crashes btw by downgrading NS Android runtime to android@6.1.0 as suggested by Neill and then in return I got a lot of ANRs :(

@NathanaelA

This comment was marked as abuse.

@NathanaelA NathanaelA assigned NathanaelA and unassigned vmutafov Jun 12, 2020
@NathanaelA

This comment was marked as abuse.

@NathanaelA

This comment was marked as abuse.

@saschaarthur
Copy link
Contributor

saschaarthur commented Jun 12, 2020 via email

@jessorlisa
Copy link

@NathanaelA Have you already found out what is causing the crashes in combination with the lock screen?

@NathanaelA

This comment was marked as abuse.

@NathanaelA

This comment was marked as abuse.

@shiv19
Copy link
Member Author

shiv19 commented Jun 21, 2020

@NathanaelA you are legendary <3

@saschaarthur
Copy link
Contributor

Very awesome that you found and solved this! Will try it against our app as soon as i figured out how to patch our nativescript runtime with your fix in our build cycle :)

@7ammer
Copy link

7ammer commented Jun 22, 2020

@NathanaelA! That is some Sherlock level deduction there! :) Well done and thank you for all your effort!

@jessorlisa
Copy link

@NathanaelA Thanks for all your efforts on this matter.

Any chance the fix will be part of the next runtime release? Or is there any latest development version I can install to test?

@NathanaelA

This comment was marked as abuse.

@NathanaelA

This comment was marked as abuse.

@jessorlisa
Copy link

Just updated to 6.5.2, sadly tns run android fails with:

Error executing Metadata Generator: java.nio.IntBuffer.clear()Ljava/nio/IntBuffer;
Detailed log here: ../testcrash/platforms/android/build-tools/buildMetadata.log

Unable to apply changes on device: 9A231FFAZ00184. Error is: Command ./gradlew failed with exit code 1.

../testcrash/platforms/android/build-tools/buildMetadata.log:

java.lang.NoSuchMethodError: java.nio.IntBuffer.clear()Ljava/nio/IntBuffer;
	at com.telerik.metadata.Writer.writeTree(Writer.java:349)
	at com.telerik.metadata.Generator.main(Generator.java:60)

Steps to reproduce:

tns create testcrash --js
cd testcrash
tns platform add android // now 6.5.0 is added
tns platform remove android
tns platform add android // latest version 6.5.2 is added
tns run android

Is there anything else that needs to be updated?

tns info   
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 6.7.4 and the latest available version is 6.7.8.
✔ Component tns-core-modules has 6.5.8 version and is up to date.
✔ Component tns-android has 6.5.2 version and is up to date.

@saschaarthur
Copy link
Contributor

saschaarthur commented Jul 8, 2020

@NathanaelA

Can fully confirm, that all our pipelines turned red after updating to the latest ns runtime..
Everyone updating Nativescript currently, resulting in a broken runtime version..

It should be very fast fixed / the release should be rollbacked, otherwise i see a flood of issues created..

The release should have been blocked by a working CI system (#1623).
Im willing to support here if needed, just let me know where to start..

Anyways the reason for this seems to be: https://jira.mongodb.org/browse/JAVA-2559
(prob a lib/java) was updated to use java-9?!

@NathanaelA

This comment was marked as abuse.

@NathanaelA

This comment was marked as abuse.

@saschaarthur
Copy link
Contributor

saschaarthur commented Jul 8, 2020

Yep, it does look like the issues is a Java 8 vs Java 9+ issues (Oracle had a breaking change apparently between 8 & 9). And the CI system would NOT have caught this, unless we had a CI on Java 8 as the build occurred on a newer Java 9+ system and the code runs FINE on Java 9+. I apologize; running this locally worked perfectly for me and others I had do tests, so it slipped thru the cracks. But this does point out that we should have a CI running Java 8, so that we can catch any of these types of issues before they go out.

No worries, thanks for all the affort you put into nativescript!

Im just curious and im wondering.. we didnt upgrade any java version at all, also the breaking line is nothing new and inplace since 2019 or so..

So java version seems to be selected during the build process, hows this working for you and the others but for us it didnt?

@NathanaelA

This comment was marked as abuse.

@jessorlisa
Copy link

@NathanaelA We released our app with the android runtime v6.5.3 a few days ago. No more alarming crash rates.

Thanks again for all your time on this.

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

Successfully merging a pull request may close this issue.