EddyVerbruggen / nativescript-bluetooth-demo

30 stars 21 forks source link

Successful build the app, but when I run , get this #28

Open lessabruno opened 5 years ago

lessabruno commented 5 years ago

An uncaught Exception occurred on "main" thread. Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function TypeError: application.start is not a function File: "file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js, line: 141, column: 12

StackTrace: Frame: function:'', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js', line: 141, column: 13 Frame: function:'./app.js', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js', line: 147, column: 30 Frame: function:'_webpackrequire', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/runtime.js', line: 751, column: 30 Frame: function:'checkDeferredModules', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/runtime.js', line: 44, column: 23 Frame: function:'webpackJsonpCallback', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/runtime.js', line: 31, column: 19 Frame: function:'', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js', line: 2, column: 57 Frame: function:'require', file:'', line: 1, column: 266

TypeError: application.start is not a function

StackTrace: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function TypeError: application.start is not a function File: "file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js, line: 141, column: 12

StackTrace: Frame: function:'', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js', line: 141, column: 13 Frame: function:'./app.js', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js', line: 147, column: 30 Frame: function:'_webpackrequire', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/runtime.js', line: 751, column: 30 Frame: function:'checkDeferredModules', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/runtime.js', line: 44, column: 23 Frame: function:'webpackJsonpCallback', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/runtime.js', line: 31, column: 19 Frame: function:'', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js', line: 2, column: 57 Frame: function:'require', file:'', line: 1, column: 266

TypeError: application.start is not a function at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6065) at android.app.ActivityThread.-wrap1(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: com.tns.NativeScriptException: Error calling module function TypeError: application.start is not a function File: "file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js, line: 141, column: 12

StackTrace: Frame: function:'', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js', line: 141, column: 13 Frame: function:'./app.js', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/bundle.js', line: 147, column: 30 Frame: function:'_webpackrequire', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/runtime.js', line: 751, column: 30 Frame: function:'checkDeferredModules', file:'file:///data/data/org.nativescript.bluetoothdemo/files/app/runtime.js', line: 44, column: 23 Frame: function:'webpackJsonpCallback', file:'file:///data/data/org.nativesc…

kmahl commented 4 years ago

+1

RahhalM commented 4 years ago

I have managed to get around this, in the app.js change the : application.start({ moduleName: 'main-page' });

to : application.run({ moduleName: 'main-page' });

it will work now, but now every time we call an event, we will have a similar error, currently working on the issue

RahhalM commented 4 years ago

okay so, I think you have downloaded the project as a zip file (just as I did before) not by gitclone. when you download the file by git clone all the errors are gone (at least for me ).

RahhalM commented 4 years ago

use this link and it will work : git clone git@github.com:EddyVerbruggen/nativescript-bluetooth.git

NOT!! : git clone git@github.com:EddyVerbruggen/nativescript-bluetooth-demo.git