Live Sync not working in Emulator


#1

Every time I have to run tns build android and then tns run android for seeing the changes that I have made to my code in the emulator.
When I save my code , in the command prompt process has died message comes and I could not proceed further, I have to kill the process using ctrl+c and then run tns build android, then tns build android
Previously like this never happened, what’s the issue ? Please help…


#2

Below is the error log I have received in command prompt. I could not find what is the issue, please help.
Executing before-prepare hook from F:\GoodBooks Beta\hooks\before-prepare\nativescript-dev-android-snapshot.js
Preparing project…
Project successfully prepared (Android)
Executing after-prepare hook from F:\GoodBooks Beta\hooks\after-prepare\nativescript-dev-android-snapshot.js
Successfully transferred login.js.
Refreshing application…
Successfully synced application org.nativescript.GoodBooksBeta on device 169.254.109.177:5555.
ActivityManager: Start proc org.nativescript.GoodBooksBeta for activity org.nativescript.GoodBooksBeta/com.tns.NativeScriptActivity: pid=5328 uid=10068 gids={50068, 3003, 1028, 1015}
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: Error: Building UI from XML. @file:///app/app-root.xml:1:1
System.err: > Unexpected token )
System.err: File: "file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 244, column: 20
System.err: StackTrace:
System.err: Frame: function:‘ScopeError’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/utils/debug.js’, line: 63, column: 24
System.err: Frame: function:‘SourceError’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/utils/debug.js’, line: 74, column: 23
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 263, column: 17
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 244, column: 33
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/xml/xml.js’, line: 148, column: 13
System.err: Frame: function:‘EasySAXParser.parse’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/js-libs/easysax/easysax.js’, line: 751, column: 23
System.err: Frame: function:‘XmlParser.parse’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/xml/xml.js’, line: 195, column: 22
System.err: Frame: function:‘XmlStringParser.parse’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 250, column: 27
System.err: Frame: function:‘parseInternal’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 212, column: 11
System.err: Frame: function:‘loadInternal’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 117, column: 27
System.err: Frame: function:‘loadPage’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 53, column: 27
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 72, column: 12
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 86, column: 20
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: 825, column: 50
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:2184)
System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
System.err: at android.app.ActivityThread.access$800(ActivityThread.java:135)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
System.err: at android.os.Looper.loop(Looper.java:136)
System.err: at android.app.ActivityThread.main(ActivityThread.java:5001)
System.err: at java.lang.reflect.Method.invokeNative(Native Method)
System.err: at java.lang.reflect.Method.invoke(Method.java:515)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
System.err: at dalvik.system.NativeStart.main(Native Method)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err: Error: Building UI from XML. @file:///app/app-root.xml:1:1
System.err: > Unexpected token )
System.err: File: "file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 244, column: 20
System.err: StackTrace:
System.err: Frame: function:‘ScopeError’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/utils/debug.js’, line: 63, column: 24
System.err: Frame: function:‘SourceError’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/utils/debug.js’, line: 74, column: 23
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 263, column: 17
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 244, column: 33
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/xml/xml.js’, line: 148, column: 13
System.err: Frame: function:‘EasySAXParser.parse’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/js-libs/easysax/easysax.js’, line: 751, column: 23
System.err: Frame: function:‘XmlParser.parse’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/xml/xml.js’, line: 195, column: 22
System.err: Frame: function:‘XmlStringParser.parse’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 250, column: 27
System.err: Frame: function:‘parseInternal’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 212, column: 11
System.err: Frame: function:‘loadInternal’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 117, column: 27
System.err: Frame: function:‘loadPage’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 53, column: 27
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 72, column: 12
System.err: Frame: function:’’, file:‘file:///data/data/org.nativescript.GoodBooksBeta/files/app/tns_modules/tns-core-modules/ui/builder/builder.js’, line: 86, column: 20
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: 825, column: 50
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:5231)
System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
System.err: … 11 more
ActivityManager: Process org.nativescript.GoodBooksBeta (pid 5328) has died.


#3

Do you have nativescript-dev-android-snapshot plugin in your package.json, if then remove it. It was deprecated long back.

And do not use snapshot builds, it doesn’t work on Windows - known limitation.


#4

ok sir… I will check this.