NativeScript / android

NativeScript for Android using v8
https://docs.nativescript.org/guide/android-marshalling
Apache License 2.0
532 stars 135 forks source link

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

Closed shiv19 closed 4 years ago

shiv19 commented 5 years ago

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 commented 5 years ago

Duplicate of this issue i think https://github.com/NativeScript/NativeScript/issues/8037 and it should contain a fix too

shiv19 commented 5 years ago

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

farfromrefug commented 5 years ago

@shiv19 ok sorry looked at the last message! Sorry

maxorlovsky commented 5 years ago

deleted mine, to not confuse anyone else

Jmchemama commented 4 years ago

I have same issue.

anmaitrannguyen commented 4 years ago

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

vtrifonov commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Was anyone able to solve that?

7ammer commented 4 years ago

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 commented 4 years ago

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

"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 commented 4 years ago

@anmaitrannguyen - can you 100% confirm the issue started when you jumped from 6.1.2 (Do you know which specific versions of core modules & runtime in the 6.1.2 set you used before it started crashing)

Nailing down the exact point it started is critical in trying to figure out what change could have caused this issue, since the log is non-existent.


I assume based on this issue and the other issue in the runtime that nobody has been able to duplicate it locally; just clients and seeing your error count on the nice dashboard.

One possible idea on how to duplicate it locally;

  1. Deinstall the app on your android 9/10 phone. (Make sure you are on Android 9 or 10!)
  2. Install the Prior version RELEASE (working) version (what you uploaded to Google!)
  3. Install the new version (again what you uploaded to Google!)
    (It would be much better for your test if you re-use what you originally uploaded to Google; because tooling changes the APK, if you rebuild your 6.1 version using the 6.5 tooling your app could be slightly different)

You might need to Install doing a sideload and double clicking on APK you manually uploaded to your phone, DO NOT USE ADB to install, you can use ADB to copy it to the phone; but lets try and make this as close to what would happen with a client and make the phone do all the work.

If using sideload method doesn't work to duplicate it, deinstall the app; create a beta test of your app; upload GOOD version, have phone join the beta test; and download it. Then do another beta with the "broken" version so that you phone downloads and installs it from Google; rinse and repeat a few times to see if you can cause the error to occur on your device.


Specific questions we need to answer:

  1. Which specific version of Android Runtime and Core was the issue introduced
  2. Are any/all apps using Workers?

If some of you can try releasing a new "minor" fix of your app using:

If we can isolate the version of the change, we can figure out what change was introduced and then figure out why it is causing the crash...

NathanaelA commented 4 years ago

@jessorlisa @jpierront @7ammer @shiv19 @anmaitrannguyen @Jmchemama @saschaarthur

Ok, I've started a spreadsheet; it would be very helpful if you can all fill in the details for your app here: https://docs.google.com/spreadsheets/d/1qU-H3Kp-OGCmRffvfw4IejSDwpf5Un7bq-sR8XoL_X8/edit?usp=sharing

And if any of you can do testing of your app with 6.1 and/or 6.2 to see if we can narrow down where the issue occurred that would also be super!

saschaarthur commented 4 years ago

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:

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 commented 4 years ago

@saschaarthur - Awesome; hopefully that is the exact same error; as the line number is different for the handleBindApplication line. However that could be because the first several errors was from 6.4/6.5 and I assume your error was from a 6.2? (hopefully), but the call stack is pretty darn close if it isn't the same error. So I think we should proceed as if it is.

  1. Can you duplicate this on multiple devices, or only a specific device? Which one(s)?
  2. Does it occur on an emulator; or only a real device?
  3. So everything 6.2 and higher, 6.2 runtime or 6.2 core, or specifically the latest 6.2.x versions?

Does the error only occur right after a reboot?

  1. Do you do anything else; or is it when Android creates the "open" list from all the open apps after a restart?
  2. Or is it when you restart the app from the menu; or start the app from the open apps list?
NathanaelA commented 4 years ago

Ok, I'm 100% sure this is the same error. Guess I'm more tired than I thought I was -- I was reading the wrong stack. The bottom callstack is the NS callstack and it matches 100%... Good job finding the error! That actually isolates it down a lot.

I'm going to try your steps even though they don't make a lot of sense on my Android 10 test device and see if I can get the same error...

saschaarthur commented 4 years ago

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 commented 4 years ago

@saschaarthur - Ok, I must be doing something wrong. :grinning:

I created a tns create testcrash --js cd testcrash tns run android

So a fresh 6.5.x app is deployed to my Android 10 device. type
adb logcat --buffer=crash Restart the device, unlock device. adb logcat --buffer=crash And no crash...

How frequently do you see a crash? Do you have to have a version released from the Play Store, or can it be deployed to the device from the CLI? Can it be a debug version, or are you testing only signed apps?

jessorlisa commented 4 years ago

@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:

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@jessorlisa, @saschaarthur -

Thanks for the steps - Either I am blessed with incredibly stable phones, or we are still missing something...

  1. I tried it on my Android 10 and Android 9 device.
  2. I tried it on a Android 10 emulator
  3. I also cloned the Local Notification and installed his demo-js app on both Android 9 & 10 and still no crashes... Even after having rebooting while notifications were active...
  4. I tried the (4.2.1 & 4.1.5) of Local Notification plugin just to see if anything changed in his plugin that could be affecting it.

In addition I had a friend try the same steps on his Android 10 device, and no crash for any run at all...

:frowning_face:


However, since it is Local Notifications plugin, this would easily explain how/why the crash is occurring, this also makes a lot more sense as to how you can duplicate it on a reboot too.

My package.json looks like this:

{
  "nativescript": {
    "id": "org.nativescript.testCrash",
    "tns-android": {
      "version": "6.5.0"
    },
    "tns-ios": {
      "version": "6.5.0"
    }
  },
  "dependencies": {
    "@nativescript/theme": "~2.3.3",
    "nativescript-local-notifications": "4.1.5",
    "tns-core-modules": "~6.5.0"
  },
  "devDependencies": {
    "nativescript-dev-webpack": "~1.5.1"
  }}

Specifics: NS-Core = 6.5.1 NS-Local-Notification = 4.2.1


So can you tell me exactly which phones you have duplicated this using the simple steps of

tns create testcrash --js
cd testcrash
tns plugin add nativescript-local-notifications
tns run android
adb logcat --buffer=crash   <---  This actually shouldn't be needed; before reboot

(reboot) adb logcat --buffer=crash

So maybe we can track down one of these devices.

shiv19 commented 4 years ago

@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 commented 4 years ago

@shiv19 - Not even using it. Just creating a new dummy app (no code changes); adding the local notification plugin. So it is a dependency so it is linked in and will activate the two BOOT rules, which I suspect the part of the issue that people can duplicate the issue with. :-)

However, in case actual notifications are an issue; I ALSO cloned Eddy's local notification app, upgraded it to 6.5 also and also tried using that both triggering the 1 minute rule (so it triggers a new notification automatically every minute) and the single and multi-notification rule. Rebooted before and after multi-notification ran. Rebooted before and after 1 minute rule ran, also let phone sit for a while just to make sure....

Tried pretty much every variation I can think of with both my Android 9 & Android 10 phones, and had a friend try it also, both the simple empty app and the local notification. None of the three devices did the issue ever appear.

However, based on the captured callstack AND assuming it is duplicatable when you add Local-Notifications on some of the phones -- then I'm 99% sure I understand WHY it is failing; just not 100% sure what actually changed to cause it. So duplicating this would allow me to rebuild the runtime with some additional logging to verify my theory and then to trace down how to fix this issue...


Also as a small aside the patches Richard did to "fix" the issue are exactly what I expected would happen, and why I mentioned those are very unsafe changes to the runtime. Based on the issue, your customers are actually still crashing just as frequently; you just don't know about it at all now...

At this point, based on the awesome data the community has so far provided -- it is very likely they are crashing either when they get a notification (hopefully the notification is still showing and not lost) or when the user clicks on a notification.

Personally, based on my knowledge of Android I tend to think it is more likely the app is crashing out when they tap on the notification OR when a Firebase push message occurs and it is then sent to a local notification. Both of those I believe need the JS side of the engine to work; and so either one of them would launch the engine and then could cause the crash with the callstack we are seeing...

jessorlisa commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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)
7ammer commented 4 years ago

This is what the app looks like after a reboot and before I open it.

When I click on the app it simply shows the splash screen with no visual error message. At least it's not crashing while it's being used. WhatsApp Image 2020-05-03 at 13 41 23

7ammer commented 4 years ago

Has anyone noticed an increase in crashes on iOS?

NathanaelA commented 4 years ago

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

The Richard note was actually for Shiva; he did some work with nStudio and he add some additional try/catches in the android runtime to try and harden the runtime to eliminate crashes. However, when Shiva shared his patches with me the other day I looked through them and realized they would most certainly catch a number of errors; but then NS would just exit out, without logging anything at all. Leaving the user a "Crashed" experience but no visible crash log to google or anywhere else; just a hidden crash.

So because Shiva is running this modified runtime, I was letting him know the issue still exists in it -- it is just masked and he never sees it anyplace. I was just warning him about that... :-D


Now as to the actual issue; I'm 99% sure that all of your user are not reporting this crash because of a reboot. This is more likely that the users are seeing the same issue when the app is suspended because they went to play a game (opened facebook, or some other large app that caused the OS to swap your app out of memory), then they clicked a notification or maybe even when they brought up the list of running app; it triggers the same code path as you have discovered when you reboot the phone -- as the app is also in a "paged out" state on reboot...


Sounds like I need to order a OneTouch 5T or 6T to see if I can track this down.

I actually tried switching a huge number of settings on my Android 10 device; just to see if I could cause it to fail -- So not sure if I can think of any other settings that would make any sense. The only thing I can think of is that the launcher on my android 10 and android 9 devices are the using same Samsung launcher and so they have something in it on these two devices that is mitigating it unintentionally.

saschaarthur commented 4 years ago

He did some work with nStudio and he add some additional try/catches in the android runtime to try and harden the runtime to eliminate crashes. However, when Shiva shared his patches with me the other day I looked through them and realized they would most certainly catch a number of errors; but then NS would just exit out, without logging anything at all.

This is really really bad and shouldnt be like that. Try catch ignore is never a good idea and will end in very weird situations nobody will understand.. Even if its a bit offtopic, do you mind to share the places where this happens ? Im curious..

NathanaelA commented 4 years ago

@saschaarthur - This is a custom runtime that Shiva (@shiv19) who opened this thread is currently running and he mentioned to me he is no longer seeing this issue, which originally I thought was AWESOME, what was changed so we can get a PR to get it fixed for everyone! :grinning: So, I finally had a chance to go through the changes, and it was my whole point I was pointing out, is that the issue is still happening to his customers, it is just is masked.

Please note; Richard, has done other really good work; and some of his changes are actually in the runtimes and have stabilized other issues. But this was a whole new set of patches as he was trying to eliminate some "misc" type random errors... He went a little bit too far in this case, and as such I'm sure his google dashboard looked awesome for the number of errors he was seeing, but his customers would be actually seeing it quit out w/o any logging for a whole range of issues...

shiv19 commented 4 years ago

@saschaarthur - This is a custom runtime that Shiva (@shiv19) who opened this thread is currently running and he mentioned to me he is no longer seeing this issue, which originally I thought was AWESOME, what was changed so we can get a PR to get it fixed for everyone! :grinning: So, I finally had a chance to go through the changes, and it was my whole point I was pointing out, is that the issue is still happening to his customers, it is just is masked.

Please note; Richard, has done other really good work; and some of his changes are actually in the runtimes and have stabilized other issues. But this was a whole new set of patches as he was trying to eliminate some "misc" type random errors... He went a little bit too far in this case, and as such I'm sure his google dashboard looked awesome for the number of errors he was seeing, but his customers would be actually seeing it quit out w/o any logging for a whole range of issues...

That is the reason why I haven't PRed those changes to the runtime. I'm aware that it is just masking it. It was put in there just as a workaround while I wait for the actual fix.

Tronix117 commented 4 years ago

It seems I got the exact same issue on my newest build, which is odd, is that I previously made a perfectly working release with 6.2.0, a week ago... Today I tried with 6.2.0 and 6.5.0 android runtime, and I'm getting the issue on all the phones I can test on.

If I do not build the release with --env.snapshotInDocker and --env.snapshot, it's working perfectly fine (except longer startup time).

Here is the crash log :

05-05 20:04:18.979  2423  2423 E AndroidRuntime: FATAL EXCEPTION: main
05-05 20:04:18.979  2423  2423 E AndroidRuntime: Process: fr.wikodit.xxxxx, PID: 2423
05-05 20:04:18.979  2423  2423 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{fr.wikodit.xxxxx/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Failed to create JavaScript extend wrapper for class 'com/tns/NativeScriptActivity'
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2850)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3059)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at android.app.ActivityThread.-wrap11(Unknown Source:0)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1724)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:164)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7000)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
05-05 20:04:18.979  2423  2423 E AndroidRuntime: Caused by: com.tns.NativeScriptException: Failed to create JavaScript extend wrapper for class 'com/tns/NativeScriptActivity'
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at com.tns.Runtime.createJSInstanceNative(Native Method)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at com.tns.Runtime.createJSInstance(Runtime.java:820)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at com.tns.Runtime.initInstance(Runtime.java:793)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at com.tns.NativeScriptActivity.<init>(NativeScriptActivity.java:13)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at java.lang.Class.newInstance(Native Method)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at android.app.Instrumentation.newActivity(Instrumentation.java:1181)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2840)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:    ... 9 more

Working:

tns build android --bundle --release --env.release --env.production --env.aot

Not Working:

tns build android --bundle --release --env.snapshotInDocker --env.snapshot  --env.release --env.production --env.aot

I also noticed something else, I compared the code diff, between previous week and now, and nothing changed (even within the package-lock). However the working aab release previous week was around 13/15mb, and the current (snapshoted, and not working) release is only around 9/11mb. No code has been removed, rather some code has been added, and no plugins or packages have been added or removed.

The only thing I can think of, is that I pruned docker images/containers within the week. (even that I'm not sure of)

Edit: Does not seems to belongs here, sorry I misplaced it in the wrong thread. Fyi, using a linux and not a docker snapshot made the build worked

ptrxwsmitt commented 4 years ago

Hi, I'm getting the Exception 'com.tns.NativeScriptException: metadata folder couldn't be opened!' on a Samsung S7 with Android 8.0 (SDK 26) with Release 6.5.0. This might be the same Issue. I'll try with an earlier Release.

saschaarthur commented 4 years ago

It seems I got the exact same issue on my newest build, which is odd, is that I previously made a perfectly working release with 6.2.0, a week ago... Today I tried with 6.2.0 and 6.5.0 android runtime, and I'm getting the issue on all the phones I can test on.

If I do not build the release with --env.snapshotInDocker and --env.snapshot, it's working perfectly fine (except longer startup time).

Here is the crash log :

05-05 20:04:18.979  2423  2423 E AndroidRuntime: FATAL EXCEPTION: main
05-05 20:04:18.979  2423  2423 E AndroidRuntime: Process: fr.wikodit.xxxxx, PID: 2423
05-05 20:04:18.979  2423  2423 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{fr.wikodit.xxxxx/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Failed to create JavaScript extend wrapper for class 'com/tns/NativeScriptActivity'
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2850)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3059)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.-wrap11(Unknown Source:0)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1724)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.os.Handler.dispatchMessage(Handler.java:106)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.os.Looper.loop(Looper.java:164)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.main(ActivityThread.java:7000)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at java.lang.reflect.Method.invoke(Native Method)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
05-05 20:04:18.979  2423  2423 E AndroidRuntime: Caused by: com.tns.NativeScriptException: Failed to create JavaScript extend wrapper for class 'com/tns/NativeScriptActivity'
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.tns.Runtime.createJSInstanceNative(Native Method)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.tns.Runtime.createJSInstance(Runtime.java:820)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.tns.Runtime.initInstance(Runtime.java:793)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.tns.NativeScriptActivity.<init>(NativeScriptActivity.java:13)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at java.lang.Class.newInstance(Native Method)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.Instrumentation.newActivity(Instrumentation.java:1181)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2840)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  ... 9 more

Working:

tns build android --bundle --release --env.release --env.production --env.aot

Not Working:

tns build android --bundle --release --env.snapshotInDocker --env.snapshot  --env.release --env.production --env.aot

I also noticed something odd, I compared the code diff, between previous week and now, and nothing changed (even within the package-lock). However the working aab release previous week was around 13/15mb, and the current (snapshoted, and not working) release is only around 9/11mb. No code has been removed, rather some code has been added, and no plugin or packages have been added or removed.

The only thing I can think of, is that I pruned docker images/containers within the week. (even

It seems I got the exact same issue on my newest build, which is odd, is that I previously made a perfectly working release with 6.2.0, a week ago... Today I tried with 6.2.0 and 6.5.0 android runtime, and I'm getting the issue on all the phones I can test on.

If I do not build the release with --env.snapshotInDocker and --env.snapshot, it's working perfectly fine (except longer startup time).

Here is the crash log :

05-05 20:04:18.979  2423  2423 E AndroidRuntime: FATAL EXCEPTION: main
05-05 20:04:18.979  2423  2423 E AndroidRuntime: Process: fr.wikodit.xxxxx, PID: 2423
05-05 20:04:18.979  2423  2423 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{fr.wikodit.xxxxx/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Failed to create JavaScript extend wrapper for class 'com/tns/NativeScriptActivity'
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2850)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3059)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.-wrap11(Unknown Source:0)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1724)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.os.Handler.dispatchMessage(Handler.java:106)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.os.Looper.loop(Looper.java:164)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.main(ActivityThread.java:7000)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at java.lang.reflect.Method.invoke(Native Method)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
05-05 20:04:18.979  2423  2423 E AndroidRuntime: Caused by: com.tns.NativeScriptException: Failed to create JavaScript extend wrapper for class 'com/tns/NativeScriptActivity'
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.tns.Runtime.createJSInstanceNative(Native Method)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.tns.Runtime.createJSInstance(Runtime.java:820)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.tns.Runtime.initInstance(Runtime.java:793)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at com.tns.NativeScriptActivity.<init>(NativeScriptActivity.java:13)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at java.lang.Class.newInstance(Native Method)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.Instrumentation.newActivity(Instrumentation.java:1181)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2840)
05-05 20:04:18.979  2423  2423 E AndroidRuntime:  ... 9 more

Working:

tns build android --bundle --release --env.release --env.production --env.aot

Not Working:

tns build android --bundle --release --env.snapshotInDocker --env.snapshot  --env.release --env.production --env.aot

I also noticed something odd, I compared the code diff, between previous week and now, and nothing changed (even within the package-lock). However the working aab release previous week was around 13/15mb, and the current (snapshoted, and not working) release is only around 9/11mb. No code has been removed, rather some code has been added, and no plugin or packages have been added or removed.

The only thing I can think of, is that I pruned docker images/containers within the week. (even that I'm not sure of)

i think thats something else or at least not matching the stack everyone else has here and doesnt belong here and should be an own issue?

ptrxwsmitt commented 4 years ago

Hi, I'm getting the Exception 'com.tns.NativeScriptException: metadata folder couldn't be opened!' on a Samsung S7 with Android 8.0 (SDK 26) with Release 6.5.0. This might be the same Issue. I'll try with an earlier Release.

By the way I'm getting the error every time that I execute 'tns run android', same for debug. The same Error Message was also mentioned in https://github.com/NativeScript/android-runtime/issues/1488

shiv19 commented 4 years ago

Hi, I'm getting the Exception 'com.tns.NativeScriptException: metadata folder couldn't be opened!' on a Samsung S7 with Android 8.0 (SDK 26) with Release 6.5.0. This might be the same Issue. I'll try with an earlier Release.

By the way I'm getting the error every time that I execute 'tns run android', same for debug. The same Error Message was also mentioned in https://github.com/NativeScript/android-runtime/issues/1488

What is your Target API level?

ptrxwsmitt commented 4 years ago

Hi, I'm getting the Exception 'com.tns.NativeScriptException: metadata folder couldn't be opened!' on a Samsung S7 with Android 8.0 (SDK 26) with Release 6.5.0. This might be the same Issue. I'll try with an earlier Release.

By the way I'm getting the error every time that I execute 'tns run android', same for debug. The same Error Message was also mentioned in #1488

What is your Target API level?

I used a vue template for generating the android part. I found that the target level is 17 inside gradle and android:verionName 1.0 in the manifest. i don't know yet if this shold be euqal. i did not find any way to define the target level in nativescript or a way to let me generate the gradle file and manifest via nativescript. Testing was just against api level 26 yet.

shiv19 commented 4 years ago

Can you try again with minSdk level 21 and target Sdk as 29?

ptrxwsmitt commented 4 years ago

Can you try again with minSdk level 21 and target Sdk as 29?

Yes, I tried this in the meantime, without any effect. I also tried other different settings for the minSdk and Target Sdk, also without different results. I regognized that somehow I got the app installed two times on the phone. Removing did not work from the menu ui, it brought up the stacktrace directly. I was able to remove both apps using the android system settings then.

Finally I recognized I did not have any of the Sdks installed within the sdk manager. As Nativescript did not complain about it, I thought it would not be required. I installed the sdk for my current test phone (api 26). Now I don't get the stacktrace any more, but i get an error ' has stopped'. That's how far I got until now.

ptrxwsmitt commented 4 years ago

Can you try again with minSdk level 21 and target Sdk as 29?

Found a Stacktrace on the device log...

05-08 12:48:16.042 19797 19797 D AndroidRuntime: Shutting down VM
05-08 12:48:16.045 19797 19797 E AndroidRuntime: FATAL EXCEPTION: main
05-08 12:48:16.045 19797 19797 E AndroidRuntime: Process: org.nativescript.upsteeemr, PID: 19797
05-08 12:48:16.045 19797 19797 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.nativescript.upsteeemr-F6Y_8gZsOXpm63DeHbpE_g==/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.upsteeemr-F6Y_8gZsOXpm63DeHbpE_g==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libNativeScript.so"
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at java.lang.System.loadLibrary(System.java:1657)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at com.tns.RuntimeHelper.initRuntime(RuntimeHelper.java:70)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1125)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6062)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at android.app.ActivityThread.-wrap1(Unknown Source:0)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:105)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:164)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6944)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
05-08 12:48:16.045 19797 19797 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
ptrxwsmitt commented 4 years ago

libNativeScript.so is not packaged into the .apk. Wouldn't that be required?

saschaarthur commented 4 years ago

NativeScriptException is a generell exception for everything but different issues, we should split up the Thread into different issues, otherwise we loose overview and never solve anything.

The Stack + Exception Message really matters currently, since nativescript doesnt implement sub exceptions what i already said here.

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..

saschaarthur commented 4 years ago

libNativeScript.so is not packaged into the .apk. Wouldn't that be required?

NativeScriptException is a generell exception for everything but different issues, we should split up the Thread into different issues, otherwise we loose overview and never solve anything.

The Stack + Exception Message really matters currently, since nativescript doesnt implement sub exceptions what i already said here.

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..


Can you try again with minSdk level 21 and target Sdk as 29?

Found a Stacktrace on the device log...

05-08 12:48:16.042 19797 19797 D AndroidRuntime: Shutting down VM 05-08 12:48:16.045 19797 19797 E AndroidRuntime: FATAL EXCEPTION: main 05-08 12:48:16.045 19797 19797 E AndroidRuntime: Process: org.nativescript.upsteeemr, PID: 19797 05-08 12:48:16.045 19797 19797 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.nativescript.upsteeemr-F6Y_8gZsOXpm63DeHbpE_g==/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.upsteeemr-F6Y_8gZsOXpm63DeHbpE_g==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libNativeScript.so" 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1011) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1657) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at com.tns.RuntimeHelper.initRuntime(RuntimeHelper.java:70) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1125) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6062) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:105) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6944) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 05-08 12:48:16.045 19797 19797 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

This is a different thing and its related that you dont build you aab correct, either build it correct (check the logs some part of your builds failing) or remove aab for now. Have a look here, you prob have the same: https://github.com/NativeScript/nativescript-dev-webpack/issues/1134

jessorlisa commented 4 years ago

@shiv19 Maybe you could update the issue title to "com.tns.NativeScriptException: metadata folder couldn't be opened!" ?

ptrxwsmitt commented 4 years ago

Getting the error again after deleting the platforms folder.

Edit: removed stacktrace, that was leading nowhere.

As it seems the metadata generator is correctly started but is not generating any *.dat files

23:32:57.082 [DEBUG] [org.gradle.api.internal.tasks.execution.DefaultTaskFingerprinter] Fingerprinting property classpath (Classpath) for task ':app:buildMetadata'
23:32:57.082 [INFO] [org.gradle.internal.execution.steps.ResolveCachingStateStep] Caching disabled for task ':app:buildMetadata' because:
  Build cache is disabled
23:32:57.083 [DEBUG] [org.gradle.internal.execution.steps.SkipUpToDateStep] Determining if task ':app:buildMetadata' is up-to-date
23:32:57.083 [INFO] [org.gradle.internal.execution.steps.SkipUpToDateStep] Task ':app:buildMetadata' is not up-to-date because:
  No history is available.
23:32:57.083 [DEBUG] [org.gradle.internal.execution.steps.CreateOutputsStep] Ensuring parent directory exists for property $1$1 at C:\Development\workspaces\private\my-drawer-vue\platforms\android\app\src\main\assets\metadata\treeNodeStream.dat
23:32:57.083 [DEBUG] [org.gradle.internal.execution.steps.CreateOutputsStep] Ensuring parent directory exists for property $1$2 at C:\Development\workspaces\private\my-drawer-vue\platforms\android\app\src\main\assets\metadata\treeStringsStream.dat
23:32:57.083 [DEBUG] [org.gradle.internal.execution.steps.CreateOutputsStep] Ensuring parent directory exists for property $1$3 at C:\Development\workspaces\private\my-drawer-vue\platforms\android\app\src\main\assets\metadata\treeValueStream.dat
23:32:57.083 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':app:buildMetadata'.
23:32:57.083 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute doFirst {} action for :app:buildMetadata' started
23:32:57.086 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute doFirst {} action for :app:buildMetadata'
23:32:57.086 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute doFirst {} action for :app:buildMetadata' completed
23:32:57.086 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute exec for :app:buildMetadata' started
23:32:57.086 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'C:\Development\tools\java\jdk-8.0_201\bin\java.exe''. Working directory: C:\Development\workspaces\private\my-drawer-vue\platforms\android\build-tools Command: C:\Development\tools\java\jdk-8.0_201\bin\java.exe -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -jar android-metadata-generator.jar verbose
23:32:57.086 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process 'command 'C:\Development\tools\java\jdk-8.0_201\bin\java.exe'': {USERDOMAIN_ROAMINGPROFILE=DESKTOP-PHVQKLV, PROCESSOR_LEVEL=6, SESSIONNAME=Console, ALLUSERSPROFILE=C:\ProgramData, PROCESSOR_ARCHITECTURE=AMD64, ANDROID_HOME=C:\Users\Patrick Waldschmitt\AppData\Local\Android\Sdk, PSModulePath=C:\Users\Patrick Waldschmitt\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules, SystemDrive=C:, DIRNAME=C:\Development\workspaces\private\my-drawer-vue\platforms\android\, USERNAME=Patrick Waldschmitt, CMD_LINE_ARGS=assembleDebug --stacktrace --debug -PcompileSdk=android-29 -PtargetSdk=29 -PbuildToolsVersion=29.0.3 -PgenerateTypings=false, ProgramFiles(x86)=C:\Program Files (x86), APP_HOME=C:\Development\workspaces\private\my-drawer-vue\platforms\android\, PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL, DriverData=C:\Windows\System32\Drivers\DriverData, OneDriveConsumer=C:\Users\Patrick Waldschmitt\OneDrive, ProgramData=C:\ProgramData, ProgramW6432=C:\Program Files, HOMEPATH=\Users\Patrick Waldschmitt, PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 12, GenuineIntel, ProgramFiles=C:\Program Files, PUBLIC=C:\Users\Public, windir=C:\Windows, _SKIP=2, LOCALAPPDATA=C:\Users\Patrick Waldschmitt\AppData\Local, IntelliJ IDEA=C:\Program Files\JetBrains\IntelliJ IDEA 2019.2\bin;, USERDOMAIN=DESKTOP-PHVQKLV, LOGONSERVER=\\DESKTOP-PHVQKLV, JAVA_HOME=C:\Development\tools\java\jdk-8.0_201, PROMPT=$P$G, OneDrive=C:\Users\Patrick Waldschmitt\OneDrive, =C:=C:\Development\workspaces\private\my-drawer-vue\platforms\android, APPDATA=C:\Users\Patrick Waldschmitt\AppData\Roaming, JAVA_EXE=C:\Development\tools\java\jdk-8.0_201/bin/java.exe, VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\, CommonProgramFiles=C:\Program Files\Common Files, Path=C:\Program Files\AdoptOpenJDK\jdk-8.0.252.09-hotspot\bin;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Program Files (x86)\Razer\ChromaBroadcast\bin;C:\Program Files\Razer\ChromaBroadcast\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Users\Patrick Waldschmitt\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\IntelliJ IDEA 2019.2\bin;C:\HashiCorp\Vagrant\bin;C:\Program Files (x86)\Symantec\VIP Access Client\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files (x86)\WinSCP\;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\EmEditor;C:\Users\Patrick Waldschmitt\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\IntelliJ IDEA 2019.2\bin;;C:\Development\tools\node\node-v12.13.0-win-x64;C:\Development\tools\process-explorer;C:\Development\scripts;C:\Users\Patrick Waldschmitt\AppData\Local\Yarn\bin;C:\Development\tools\java\jdk-8.0_201\bin;C:\Development\tools\oc;C:\Development\tools\cwRsync_5.5.0_x86_Free\bin;C:\Development\tools\maven\apache-maven-3.6.1\bin;, OS=Windows_NT, NODE_HOME=C:\Development\tools\node\node-v12.13.0-win-x64, COMPUTERNAME=DESKTOP-PHVQKLV, PROCESSOR_REVISION=8e0c, CLASSPATH=C:\Development\workspaces\private\my-drawer-vue\platforms\android\\gradle\wrapper\gradle-wrapper.jar, CommonProgramW6432=C:\Program Files\Common Files, ComSpec=C:\Windows\system32\cmd.exe, APP_BASE_NAME=gradlew, SystemRoot=C:\Windows, TEMP=C:\Users\PATRIC~1\AppData\Local\Temp, HOMEDRIVE=C:, USERPROFILE=C:\Users\Patrick Waldschmitt, TMP=C:\Users\PATRIC~1\AppData\Local\Temp, CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files, NUMBER_OF_PROCESSORS=8}
23:32:57.086 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
23:32:57.086 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command 'C:\Development\tools\java\jdk-8.0_201\bin\java.exe'.
23:32:57.101 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
23:32:57.101 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
23:32:57.101 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command 'C:\Development\tools\java\jdk-8.0_201\bin\java.exe''
23:33:00.456 [LIFECYCLE] [org.gradle.process.internal.health.memory.MemoryManager] 
23:33:00.456 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting OS memory status event {Total: 16909922304, Free: 6037602304}
23:33:00.456 [DEBUG] [org.gradle.launcher.daemon.server.health.LowMemoryDaemonExpirationStrategy] Received memory status update: {Total: 16909922304, Free: 6037602304}
23:33:00.456 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting JVM memory status event {Maximum: 15271460864, Committed: 709885952}
23:32:59.120 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
23:32:59.120 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :app:buildMetadata
23:33:02.098 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: SUCCEEDED
23:33:02.098 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'C:\Development\tools\java\jdk-8.0_201\bin\java.exe'' finished with exit value 0 (state: SUCCEEDED)
23:33:02.098 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute exec for :app:buildMetadata'
ptrxwsmitt commented 4 years ago

I just tried to run the metadata generator manually in my project: java -D'file.encoding=windows-1252' -D'user.country=US' -D'user.language=en' -D'user.variant' -jar android-metadata-generator.jar verbose

Same again: No output was generated in the configured output directory. It seems to be an issue with the metadatagenerator.