App working on emulator, crash at launch when released


#1

Hello,

I try to release an app for 4 days now but I still have crash…

I find on of the issue : in one of my modules, I have got:
imports: [CommonModule, NativeScriptFormsModule, ReactiveFormsModule ],
With this code application run fine on emulator (tns run android) but release (tns build android --release …) crash at launch !

When I remove “NativeScriptFormsModule” application release starts without error. If I had NativeScriptFormsModule in a basic HelloWorld, I don’t get any release issue…

I tried to have log informations with “adb logcat” command. Its hard to analyse because of the numbe of lines but I found this error;
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-angular", relative to: app/tns_modules/

I’m lost but I realy need to release the application :frowning:

Thanks if you have some ideas or way to get deeper…

Serge


#2

You can build the app in release, clean the adb logcat adb logcat -c, run the app, and then dump the log into a file adb logcat -d > crash-log.txt.


#3

Thanks for your answer!

I’have done that but not easy to understand what is wrong:

09-03 09:37:52.317 1592 1603 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.nativescript.flexapp/com.tns.NativeScriptActivity bnds=[24,239][230,517] (has extras)} from uid 10014 on display 0
09-03 09:37:52.320 1306 1349 D AudioFlinger: mixer(0xb3803fc0) throttle end: throttle time(38)
09-03 09:37:52.345 1592 3008 I ActivityManager: Start proc 3372:org.nativescript.flexapp/u0a73 for activity org.nativescript.flexapp/com.tns.NativeScriptActivity
09-03 09:37:52.354 1592 1608 I ActivityManager: Killing 3044:com.android.externalstorage/u0a11 (adj 906): empty #17
09-03 09:37:52.363 3372 3372 W art : Unexpected CPU variant for X86 using defaults: x86
09-03 09:37:52.436 2125 2136 W art : Suspending all threads took: 24.359ms
09-03 09:37:52.495 2125 2136 I art : Background sticky concurrent mark sweep GC freed 3619(278KB) AllocSpace objects, 10(896KB) LOS objects, 0% free, 11MB/11MB, paused 30.479ms total 106.420ms
09-03 09:37:52.506 1297 1520 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x933 imply creation of host color buffer
09-03 09:37:52.510 1592 2952 D ActivityManager: cleanUpApplicationRecord – 3044
09-03 09:37:52.511 1592 1602 I art : Background sticky concurrent mark sweep GC freed 11461(874KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 16MB/16MB, paused 12.249ms total 138.622ms
09-03 09:37:52.529 2258 2258 W SearchService: Abort, client detached.
09-03 09:37:52.535 1592 1615 D : HostConnection::get() New Host Connection established 0x96994f80, tid 1615
09-03 09:37:52.578 3372 3372 I TNS.Native: NativeScript Runtime Version 3.1.1, commit 253c76f850b88b0119fda04e413626872f223de5
09-03 09:37:52.578 3372 3372 D TNS.Native: JNI_ONLoad
09-03 09:37:52.578 3372 3372 D TNS.Native: JNI_ONLoad END
09-03 09:37:52.747 1592 1602 I art : Background partial concurrent mark sweep GC freed 2384(123KB) AllocSpace objects, 0(0B) LOS objects, 19% free, 16MB/20MB, paused 3.469ms total 217.796ms
09-03 09:37:52.984 3372 3372 D TNS.Native: Snapshot library read 0x96b75080 (9481960B).
09-03 09:37:53.019 3372 3372 D TNS.Native: V8 version 5.5.372.32
09-03 09:37:53.041 3372 3372 D TNS.Native: lenNodes=81432, lenNames=855670, lenValues=1031062
09-03 09:37:53.041 3372 3372 D TNS.Native: time=3
09-03 09:37:53.557 3372 3372 D AndroidRuntime: Shutting down VM
09-03 09:37:53.558 3372 3372 W System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:
09-03 09:37:53.558 3372 3372 W System.err:
09-03 09:37:53.558 3372 3372 W System.err: Error calling module function
09-03 09:37:53.558 3372 3372 W System.err:
09-03 09:37:53.558 3372 3372 W System.err: Error calling module function
09-03 09:37:53.558 3372 3372 W System.err:
09-03 09:37:53.558 3372 3372 W System.err: Error calling module function
09-03 09:37:53.558 3372 3372 W System.err:
09-03 09:37:53.558 3372 3372 W System.err: Error calling module function
09-03 09:37:53.558 3372 3372 W System.err:
09-03 09:37:53.558 3372 3372 W System.err: Error: com.tns.NativeScriptException: Failed to find module: “nativescript-angular”, relative to: app/tns_modules/
09-03 09:37:53.558 3372 3372 W System.err: com.tns.Module.resolvePathHelper(Module.java:146)
09-03 09:37:53.558 3372 3372 W System.err: com.tns.Module.resolvePath(Module.java:55)
09-03 09:37:53.558 3372 3372 W System.err: com.tns.Runtime.runModule(Native Method)
09-03 09:37:53.558 3372 3372 W System.err: com.tns.Runtime.runModule(Runtime.java:521)
09-03 09:37:53.558 3372 3372 W System.err: com.tns.Runtime.run(Runtime.java:513)
09-03 09:37:53.558 3372 3372 W System.err: com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
09-03 09:37:53.558 3372 3372 W System.err: android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
09-03 09:37:53.558 3372 3372 W System.err: android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
09-03 09:37:53.558 3372 3372 W System.err: android.app.ActivityThread.-wrap2(ActivityThread.java)
09-03 09:37:53.558 3372 3372 W System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
09-03 09:37:53.558 3372 3372 W System.err: android.os.Handler.dispatchMessage(Handler.java:102)
09-03 09:37:53.558 3372 3372 W System.err: android.os.Looper.loop(Looper.java:154)
09-03 09:37:53.558 3372 3372 W System.err: android.app.ActivityThread.main(ActivityThread.java:6119)
09-03 09:37:53.559 3372 3372 W System.err: java.lang.reflect.Method.invoke(Native Method)
09-03 09:37:53.559 3372 3372 W System.err: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
09-03 09:37:53.559 3372 3372 W System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
09-03 09:37:53.559 3372 3372 W System.err: File: ", line: 1, column: 265
09-03 09:37:53.559 3372 3372 W System.err:
09-03 09:37:53.559 3372 3372 W System.err: StackTrace:
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.flexapp/files/app/dynamic-form/dynamic-form.module.js’, line: 8, column: 30
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.flexapp/files/app/dynamic-page/dynamic-page.module.js’, line: 7, column: 29
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.flexapp/files/app/app.module.js’, line: 16, column: 29
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.flexapp/files/app/main.js’, line: 4, column: 20
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.559 3372 3372 W System.err:
09-03 09:37:53.559 3372 3372 W System.err:
09-03 09:37:53.559 3372 3372 W System.err: Error: com.tns.NativeScriptException: Failed to find module: “nativescript-angular”, relative to: app/tns_modules/
09-03 09:37:53.559 3372 3372 W System.err: com.tns.Module.resolvePathHelper(Module.java:146)
09-03 09:37:53.559 3372 3372 W System.err: com.tns.Module.resolvePath(Module.java:55)
09-03 09:37:53.559 3372 3372 W System.err: com.tns.Runtime.runModule(Native Method)
09-03 09:37:53.559 3372 3372 W System.err: com.tns.Runtime.runModule(Runtime.java:521)
09-03 09:37:53.559 3372 3372 W System.err: com.tns.Runtime.run(Runtime.java:513)
09-03 09:37:53.559 3372 3372 W System.err: com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
09-03 09:37:53.559 3372 3372 W System.err: android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
09-03 09:37:53.559 3372 3372 W System.err: android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
09-03 09:37:53.559 3372 3372 W System.err: android.app.ActivityThread.-wrap2(ActivityThread.java)
09-03 09:37:53.559 3372 3372 W System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
09-03 09:37:53.559 3372 3372 W System.err: android.os.Handler.dispatchMessage(Handler.java:102)
09-03 09:37:53.559 3372 3372 W System.err: android.os.Looper.loop(Looper.java:154)
09-03 09:37:53.559 3372 3372 W System.err: android.app.ActivityThread.main(ActivityThread.java:6119)
09-03 09:37:53.559 3372 3372 W System.err: java.lang.reflect.Method.invoke(Native Method)
09-03 09:37:53.559 3372 3372 W System.err: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
09-03 09:37:53.559 3372 3372 W System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
09-03 09:37:53.559 3372 3372 W System.err: File: ", line: 1, column: 265
09-03 09:37:53.559 3372 3372 W System.err:
09-03 09:37:53.559 3372 3372 W System.err: StackTrace:
09-03 09:37:53.559 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.560 3372 3372 W System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.flexapp/files/app/dynamic-form/dynamic-form.module.js’, line: 8, column: 30
09-03 09:37:53.560 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.560 3372 3372 W System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.flexapp/files/app/dynamic-page/dynamic-page.module.js’, line: 7, column: 29
09-03 09:37:53.560 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.560 3372 3372 W System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.flexapp/files/app/app.module.js’, line: 16, column: 29
09-03 09:37:53.560 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.560 3372 3372 W System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.flexapp/files/app/main.js’, line: 4, column: 20
09-03 09:37:53.560 3372 3372 W System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
09-03 09:37:53.560 3372 3372 W System.err:

Any idea ? (I run the release on the emulator but same crash one real device)


#4

Can you share your package.json file.


#5

Hello,

I find a solution yesterday but I can’t really understand why there is a difference between release and emulator:

  • First issue: I had an old version of DropDown module (nativescript-drop-down)
  • Second issue: I had import { NativeScriptFormsModule } from "nativescript-angular"; intestead of import { NativeScriptFormsModule } from "nativescript-angular/forms"; in my module

I fix it but don’t understand why it worked on emulator…

serge


#6

Did you run the application on a Samsung (S-something)?


#7

Yes and No: I try on a real S5 mini device but also to install the apk on the emulator and got the same error…