我最近尝试安装第三方插件:https://github.com/bradleygore/nativescript-materialdropdownlist并按照自述文件使用它。在我运行我的应用程序并遇到错误之前,似乎没有任何异常。我很快注意到它试图在错误的文件夹中找到插件。
<Page
xmlns="http://www.nativescript.org/tns.xsd"
xmlns:ns="nativescript-pro-ui/sidedrawer"
xmlns:mdl="nativescript-materialdropdownlist"
xmlns:drawer="pages/home/shared/drawer"
xmlns:header="pages/home/shared/header"
class="page" loaded="onNavigatingTo">
<header:header title="{{ title }}" openDrawer="{{ openDrawer }}"/>
<ns:RadSideDrawer id="sideDrawer" drawerLocation='Left' showOverNavigation='true'>
<ns:RadSideDrawer.drawerContent>
<drawer:drawer active="pages/home/rooms/rooms"/>
</ns:RadSideDrawer.drawerContent>
<ns:RadSideDrawer.mainContent>
<ScrollView>
<StackLayout>
<mdl:MaterialDropdownList col="1" id="ddlColors" itemSeparatorColor="gray" itemRowsHeight="30" items="{{ colors }}" selectedIndex="{{ selectedColorIndex }}"></mdl:MaterialDropdownList>
</StackLayout>
</ScrollView>
</ns:RadSideDrawer.mainContent>
</ns:RadSideDrawer>
</Page>
堆栈跟踪
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.greywallsoftware.GWSInternal/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err:
System.err: Error: Building UI from XML. @file:///app/pages/home/rooms/rooms.xml:16:21
System.err: > Module '/data/data/com.greywallsoftware.GWSInternal/files/app/nativescript-materialdropdownlist' not found for element 'nativescript-materialdropdownlist:MaterialDropdownList'.
System.err: > com.tns.NativeScriptException: Failed to find module: "/data/data/com.greywallsoftware.GWSInternal/files/app/nativescript-materialdropdownlist", relative to: app//
System.err: com.tns.Module.resolvePathHelper(Module.java:146)
System.err: com.tns.Module.resolvePath(Module.java:55)
System.err: com.tns.Runtime.callJSMethodNative(Native Method)
System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
System.err: android.app.Activity.performCreate(Activity.java:6975)
System.err: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
System.err: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
System.err: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
System.err: android.app.ActivityThread.-wrap11(Unknown Source:0)
System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
System.err: android.os.Handler.dispatchMessage(Handler.java:105)
System.err: android.os.Looper.loop(Looper.java:164)
System.err: android.app.ActivityThread.main(ActivityThread.java:6541)
System.err: java.lang.reflect.Method.invoke(Native Method)
System.err: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
System.err: File: "file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 196, column: 20
System.err:
System.err: StackTrace:
System.err: Frame: function:'ScopeError', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 63, column: 24
System.err: Frame: function:'SourceError', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 74, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 215, column: 17
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 196, column: 33
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 148, column: 13
System.err: Frame: function:'EasySAXParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/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/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 195, column: 22
System.err: Frame: function:'XmlStringParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 202, column: 27
System.err: Frame: function:'parseInternal', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 47, column: 11
System.err: Frame: function:'loadPage', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 131, column: 27
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 112, column: 26
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 131, column: 20
System.err: Frame: function:'FrameBase.navigate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 185, column: 28
System.err: Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 615, column: 19
System.err: Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25
System.err:
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
System.err: at android.app.ActivityThread.-wrap11(Unknown Source:0)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
System.err: at android.os.Handler.dispatchMessage(Handler.java:105)
System.err: at android.os.Looper.loop(Looper.java:164)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6541)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err:
System.err: Error: Building UI from XML. @file:///app/pages/home/rooms/rooms.xml:16:21
System.err: > Module '/data/data/com.greywallsoftware.GWSInternal/files/app/nativescript-materialdropdownlist' not found for element 'nativescript-materialdropdownlist:MaterialDropdownList'.
System.err: > com.tns.NativeScriptException: Failed to find module: "/data/data/com.greywallsoftware.GWSInternal/files/app/nativescript-materialdropdownlist", relative to: app//
System.err: com.tns.Module.resolvePathHelper(Module.java:146)
System.err: com.tns.Module.resolvePath(Module.java:55)
System.err: com.tns.Runtime.callJSMethodNative(Native Method)
System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
System.err: android.app.Activity.performCreate(Activity.java:6975)
System.err: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
System.err: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
System.err: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
System.err: android.app.ActivityThread.-wrap11(Unknown Source:0)
System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
System.err: android.os.Handler.dispatchMessage(Handler.java:105)
System.err: android.os.Looper.loop(Looper.java:164)
System.err: android.app.ActivityThread.main(ActivityThread.java:6541)
System.err: java.lang.reflect.Method.invoke(Native Method)
System.err: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
System.err: File: "file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 196, column: 20
System.err:
System.err: StackTrace:
System.err: Frame: function:'ScopeError', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 63, column: 24
System.err: Frame: function:'SourceError', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 74, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 215, column: 17
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 196, column: 33
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 148, column: 13
System.err: Frame: function:'EasySAXParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/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/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 195, column: 22
System.err: Frame: function:'XmlStringParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 202, column: 27
System.err: Frame: function:'parseInternal', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 47, column: 11
System.err: Frame: function:'loadPage', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 131, column: 27
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 112, column: 26
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 131, column: 20
System.err: Frame: function:'FrameBase.navigate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 185, column: 28
System.err: Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 615, column: 19
System.err: Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25
System.err:
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:6975)
System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
System.err: ... 9 more
该模块肯定在我的node_modules文件夹中,但{N}正在尝试从/ app / nativescript-materialdropdownlist而不是/ app / tns_modules / nativescript-materialdropdownlist加载它,它实际上位于build的输出中。
我尝试删除平台文件夹并重建。我已经尝试删除node_modules并重新安装所有内容。我不知道还能做什么。