【发布时间】:2016-11-26 17:45:57
【问题描述】:
我创建了一个非常基本的 Nativescript Android 应用程序,它使用 nativescript-barcodescanner 插件。该应用程序成功构建,但是当它部署在模拟器上时,我收到以下错误。知道我可以做些什么来解决这个问题或可能是什么原因造成的吗?
错误:
java.lang.RuntimeException: Unable to resume activity {org.nativescript.barcodescanner/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreateView failed
Error: File /data/data/org.nativescript.barcodescanner/files/app/.components/information/information.component.html does not exist. Resolved from: .components/information/information.component.html.
File: "/data/data/org.nativescript.barcodescanner/files/app/tns_modules/nativescript-angular/resource-loader.js, line: 22, column: 12
StackTrace:
Frame: function:'FileSystemResourceLoader.get', file:'/data/data/org.nativescript.barcodescanner/files/app/tns_modules/nativescript-angular/resource-loader.js', line: 22, column: 19
Frame: function:'DirectiveNormalizer._fetch', file:'/data/data/org.nativescript.barcodescanner/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js', line: 13661, column: 45
Frame: function:'DirectiveNormalizer.normalizeTemplateAsync', file:'/data/data/org.nativescript.barcodescanner/files/
还有我的命令提示符的最后几行:
BUILD SUCCESSFUL
Total time: 1 mins 9.45 secs
Project successfully built
Successfully deployed on device with identifier '192.168.8.101:5555'.
W/System.err( 2258): at com.tns.Runtime.callJSMethodNative(Native Method)
W/System.err( 2258): at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:865)
W/System.err( 2258): at com.tns.Runtime.callJSMethodImpl(Runtime.java:730)
W/System.err( 2258): at com.tns.Runtime.callJSMethod(Runtime.java:716)
W/System.err( 2258): at com.tns.Runtime.callJSMethod(Runtime.java:697)
W/System.err( 2258): at com.tns.Runtime.callJSMethod(Runtime.java:687)
【问题讨论】:
-
它似乎找不到
.components/information/information.component.html并阻止恢复活动,也许你的相对路径或其他东西有问题(比如组件而不是.components) -
@HabibKazemi 感谢这对您有很大帮助,请将其添加为答案。结果是我的一个组件中的 templateUrl 不正确...
-
我很高兴能帮上忙 :)
标签: android typescript nativescript