在Mac上运行this应用程序,使用nativescript-socketio模块的tns 2.4.0 npm 3.10.9。错误:
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: com.tns.NativeScriptException: Failed to find module: "nativescript-socketio", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:159)
com.tns.Module.resolvePath(Module.java:60)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:514)
com.tns.Runtime.run(Runtime.java:509)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518)
android.app.ActivityThread.access$1500(ActivityThread.java:144)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
android.os.Handler
此错误出现在tns2.4.0中,但不出现在tns2.5.0中。
确保在组件中添加了[moduleId:module.id]。
例如:
@Component({moduleId:module.id,selector:'ns-selector',templateUrl:'selector.component.html'})