Open waszqba opened 5 years ago
Does the demo (not the demo-ng) app work for you?
I can add that setting timeout in then
didn't help and threw errors that it cannot find 'call' of undefined
, but when I called a method in then
and in that method used setTimeout
, it worked. it seems like some kind of binding issue o_0
Does the demo (not the demo-ng) app work for you?
I just copied the code from the demo to my application
I'd like to know if the demo app itself works. That will help determining whether or not it's a problem in your code.
I will let you know soon
well, the demo-ng
app didn't even launch, it throws
An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:
Error calling module function
Error calling module function
Error calling module function
Error calling module function
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'', line: 1, column: 266
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'
', line: 1, column: 266
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'', line: 1, column: 266
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'', line: 1, column: 266
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runMo
dule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'', line: 1, column: 266
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5879)
at android.app.ActivityThread.-wrap3(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: com.tns.NativeScriptException:
Error calling module function
Error calling module function
Error calling module function
Error calling module function
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'', line: 1, column: 266
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'', line: 1, column: 266
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'', line: 1, column: 266
Error: com.tns.NativeScriptException: Failed to
find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'', line: 1, column: 266
Error: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:146)
com.tns.Module.resolvePath(Module.java:55)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
android.app.ActivityThread.-wrap3(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/item/item-detail.component.js', line: 6, column: 37
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.routing.js', line: 6, column: 31
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/app.module.js', line: 5, column: 21
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'file:///data/data/org.nativescript.demong/files/app/main.js', line: 5, column: 20
Frame: function:'require', file:'', line: 1, column: 266
at com.tns.Runtime.runModule(Native Method)
at com.tns.Runtime.runModule(Runtime.java:553)
at com.tns.Runtime.run(Runtime.java:545)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
at android.app.ActivityTh
read.handleBindApplication(ActivityThread.java:5876)
... 8 more
at me
Like I said, not the demo-ng app. Thatβs for iOS.
ah, ok, I misunderstood, will try again then
unfotunately, the demo
w/o -ng
didn't work either :( I am using node 8.11.3 and tns 5.0.0. :
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.plugindemo.barcodescanner/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
System.err: at android.app.ActivityThread.-wrap14(ActivityThread.java)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
System.err: at android.os.Looper.loop(Looper.java:154)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6682)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
System.err: Caused by: com.tns.NativeScriptException: Failed to find module: "nativescript-barcodescanner", relative to: app/tns_modules/
System.err: at com.tns.Module.resolvePathHelper(Module.java:146)
System.err: at com.tns.Module.resolvePath(Module.java:55)
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
System.err: at android.app.Activity.performCreate(Activity.java:6942)
System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
System.err: ... 9 more
Follow these exact steps: https://github.com/EddyVerbruggen/nativescript-barcodescanner#want-a-quick-demo
well ,still no luck
MacBook-Pro-Jakub:src kuba$ npm run demo.android
> nativescript-barcodescanner@2.7.9 demo.android /Users/kuba/projects/TestApp/barcodedemo/src
> npm run build && cd ../demo && tns run android --syncAllFiles
> nativescript-barcodescanner@2.7.9 build /Users/kuba/projects/TestApp/barcodedemo/src
> npm i && npm run tsc
audited 82 packages in 1.769s
found 0 vulnerabilities
> nativescript-barcodescanner@2.7.9 tsc /Users/kuba/projects/TestApp/barcodedemo/src
> tsc -skipLibCheck
Searching for devices...
npm WARN demo No description
npm WARN demo No repository field.
npm WARN demo No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/chokidar/node_modules/fsevents):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/Users/kuba/projects/TestApp/barcodedemo/demo/node_modules/.staging/fsevents-4fb80347/node_modules/set-blocking' -> '/Users/kuba/projects/TestApp/barcodedemo/demo/node_modules/.staging/set-blocking-dc466114'
npm ERR! path /Users/kuba/projects/TestApp/barcodedemo/demo/node_modules/.staging/nativescript-barcodescanner-54cdba1d/node_modules/ansi-regex
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/kuba/projects/TestApp/barcodedemo/demo/node_modules/.staging/nativescript-barcodescanner-54cdba1d/node_modules/ansi-regex' -> '/Users/kuba/projects/TestApp/barcodedemo/demo/node_modules/.staging/ansi-regex-9ea0e50e'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kuba/.npm/_logs/2018-12-11T11_52_13_580Z-debug.log
Command npm install failed with exit code 254
# tns run android
### Description
Runs your project on a connected Android device or Android emulator, if configured. This is shorthand for prepare, build and deploy. While your app is running, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with all selected devices and restarts/refreshes the application.
To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in this wiki: https://github.com/NativeScript/nativescript-angular/wiki/HMR.
### Commands
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Usage β Synopsis β
β Run on all connected devices and running emulators β $ tns run android [--key-store-path <File Path> --key-store-password <Password> --key-store-alias <Name> --key-store-alias-password <Password>] [--release] [--justlaunch] [--bundle [<value>] [--env.*]] β
β Run on a selected connected device or running emulator. Will start emulator with specified Device Identifier, if not already running. β $ tns run android --device <Device ID> [--key-store-path <File Path> --key-store-password <Password> --key-store-alias <Name> --key-store-alias-password <Password>] [--release] [--justlaunch] [--bundle [<value>] [--env.*]] β
β Start a default emulator if none are running, or run application on all connected emulators. β $ tns run android --emulator [--key-store-path <File Path> --key-store-password <Password> --key-store-alias <Name> --key-store-alias-password <Password>] [--release] [--justlaunch] [--bundle [<value>] [--env.*]] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
### Options
* --device - Specifies a connected device or emulator to start and run the app. <Device ID> is the index or Device Identifier of the target device as listed by the $ tns device android --available-devices command.
* --emulator - If set, runs the app in all available and configured Android emulators. It will start an emulator if none are already running.
* --justlaunch - If set, does not print the application output in the console.
* --clean - If set, forces the complete rebuild of the native application.
* --no-watch - If set, changes in your code will not be reflected during the execution of this command.
* --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options.
* --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
* --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
* --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
* --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
* --bundle - Specifies that the webpack bundler will be used to bundle the application.
* --hmr - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on webpack and adding the --hmr flag to the command will automatically enable the --bundle option as well. The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.
* --env.* - Specifies additional flags that the bundler may process. May be passed multiple times. For example: --env.uglify --env.snapshot.
* --syncAllFiles - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary!
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! nativescript-barcodescanner@2.7.9 demo.android: `npm run build && cd ../demo && tns run android --syncAllFiles`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the nativescript-barcodescanner@2.7.9 demo.android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kuba/.npm/_logs/2018-12-11T11_52_13_705Z-debug.log
MacBook-Pro-Jakub:src kuba$
Perhaps the package-lock.json file is bothering you - try to remove it.
On Android when I try to use scanner as in demo (with the default alert on
.then
) I only get a 2 second freeze and this:in console I know this stack trace is not much of a help, but as a conversation starter it ma be enough :) Is there any thing that I can do to make it work quickly?