In Release Build App is not working (Unfortunately app stopped message coming )


#1

Help me for resolving this issue.
Below is my error log in command prompt
Successfully started on device with identifier ‘JN9LRWZ5FQJV55AY’.
ActivityManager: Start proc 7479:org.nativescript.GoodBooksBeta/u0a381 for activity org.nativescript.GoodBooksBeta/com.tns.NativeScriptActivity
ActivityManager: publishContentProviders: from caller=android.app.ApplicationThreadProxy@4c1de31 (pid=7479)
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.GoodBooksBeta/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err: TypeError: Cannot read property ‘create’ of undefined
System.err: File: "file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 13
System.err: StackTrace:
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 75, column: 14
System.err: Frame: function:‘FrameBase.navigate’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js’, line: 118, column: 30
System.err: Frame: function:‘ActivityCallbacksImplementation.setActivityContent’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 818, column: 30
System.err: Frame: function:‘ActivityCallbacksImplementation.onCreate’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 677, column: 14
System.err: Frame: function:‘NativeScriptActivity.onCreate’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/frame/activity.js’, line: 20, column: 25
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2667)
System.err: at android.app.ActivityThread.-wrap11(ActivityThread.java)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1494)
System.err: at android.os.Handler.dispatchMessage(Handler.java:111)
System.err: at android.os.Looper.loop(Looper.java:207)
System.err: at android.app.ActivityThread.main(ActivityThread.java:5776)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err: TypeError: Cannot read property ‘create’ of undefined
System.err: File: "file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 13
System.err: StackTrace:
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 75, column: 14
System.err: Frame: function:‘FrameBase.navigate’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js’, line: 118, column: 30
System.err: Frame: function:‘ActivityCallbacksImplementation.setActivityContent’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 818, column: 30
System.err: Frame: function:‘ActivityCallbacksImplementation.onCreate’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 677, column: 14
System.err: Frame: function:‘NativeScriptActivity.onCreate’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/frame/activity.js’, line: 20, column: 25
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1089)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:971)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:958)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:942)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:934)
System.err: at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
System.err: at android.app.Activity.performCreate(Activity.java:6582)
System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2532)
System.err: … 9 more
System.err: com.tns.NativeScriptException:
System.err: ReferenceError: console is not defined
System.err: File: "file:///data/data/org.nativescript.GoodBooksBeta/files/app/app.js, line: 315, column: 12
System.err: StackTrace:
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/app.js’, line: 315, column: 13
System.err: Frame: function:‘Observable.notify’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/data/observable/observable.js’, line: 110, column: 23
System.err: Frame: function:‘global.__onUncaughtError’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/application/application-common.js’, line: 86, column: 12
System.err: at com.tns.Runtime.passUncaughtExceptionToJsNative(Native Method)
System.err: at com.tns.Runtime.passUncaughtExceptionToJs(Runtime.java:70)
System.err: at com.tns.NativeScriptUncaughtExceptionHandler.uncaughtException(NativeScriptUncaughtExceptionHandler.java:33)
System.err: at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
System.err: at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
08-01 15:05:34.087 7479 7479 E AndroidRuntime: at com.tns.Runtime.callJSMethodNative(Native Method)
08-01 15:05:34.087 7479 7479 E AndroidRuntime: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1089)08-01 15:05:34.087 7479 7479 E AndroidRuntime: at com.tns.Runtime.callJSMethodImpl(Runtime.java:971)
08-01 15:05:34.087 7479 7479 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:958)
08-01 15:05:34.087 7479 7479 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:942)
08-01 15:05:34.087 7479 7479 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:934)
ActivityManager: Process org.nativescript.GoodBooksBeta (pid 7479) has died
ActivityManager: Dying app: ProcessRecord{5ca51fa 7479:org.nativescript.GoodBooksBeta/u0a381}, pid: 7479, thread: android.os.BinderProxy@d7b43ab
ActivityManager: SVC-handleAppDiedLocked: app = ProcessRecord{5ca51fa 7479:org.nativescript.GoodBooksBeta/u0a381}, app.pid = 7479
ActivityManager: cleanUpApplicationRecord – 7479
ActivityManager: Removing non-persistent process during cleanup: ProcessRecord{5ca51fa 7479:org.nativescript.GoodBooksBeta/u0a381}


#2

It’s pointing to a console statement, do you have any while you launch the app?


#3

Yes sir. I have many console.log statements in my app.js file


#4

Did you try commenting that and see if error gets resolved?
Are you facing this only in release build with webpack?


#5

No… Will check and revert you sir.


#6

Sir,
You are great. Thanks for your quick response. I have disabled all console.log statements and now it works fine.
But another page has some console.log statement due to which that page function is not working.
Should I comment all my console.log statements in all the pages of my app?


#7

I’m not sure why console log throws error until I have it reproduced, in my apps I never found an issue with that.


#8

Hmm. Let me check the code once again sir .


#9

Sir,
I think it the issue is not related to console.log statements, Once the app has been built successfully and deployed into the emulator the first time and after which when I make some changes in my code and press save, the simultaneous changes are not visible in my emulator and this error is coming.
This is a very new issue coming today. I have been using nativescript since 5 months and these kind of issues never came.