我遇到了构建问题,我制作了一个简单的应用程序,有2个页面和一个组件运行正常但是当我构建(tns build android --bundle)时,我有这个错误消息:
ERROR in ./views/sign-up/list-page.xml
Module not found: Error: Can''t resolve 'D:devmobiletestappsharedcomponentsmenu.xml' in 'D:\dev\mobile\test\app\views\list'
@ ./views/list/list-page.xml 1:360-425 1:498-563
@ . sync (root|page)\.(xml|css|js|ts|scss)$
@ ../node_modules/nativescript-dev-webpack/register-modules.js
@ ./app.js
ERROR in ./views/home/home-page.xml
Module not found: Error: Can''t resolve 'D:devmobiletestappsharedcomponentsmenu.xml' in 'D:\dev\mobile\test\app\views\home'
@ ./views/home/home-page.xml 1:360-425 1:498-563
@ . sync (root|page)\.(xml|css|js|ts|scss)$
@ ../node_modules/nativescript-dev-webpack/register-modules.js
@ ./app.js
我的组件
<StackLayout orientation="horizontal">
<Button text="A" class="btn btn-rounded-lg btn-active btn-outline" width="25%"></Button>
<Button text="B" class="btn btn-rounded-lg btn-active btn-outline" width="25%"></Button>
<Button text="C" class="btn btn-rounded-lg btn-active btn-outline" width="25%"></Button>
</StackLayout>
我的页面XML
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:components="shared/components" navigatingTo="onNavigatingTo" class="page" actionBarHidden="true">
感谢!!!
答案 0 :(得分:0)
我也遇到了与最新的nativescript-dev-webpack相同的问题,我发现如果所有页面都在根文件夹中,其名称以&#34; page&#结尾34;然后它的工作。
答案 1 :(得分:0)
更新至/**
* Returns the default link's IP addresses, if any, taking into account IPv4 and IPv6 style
* addresses.
* @param context the application context
* @return the formatted and newline-separated IP addresses, or null if none.
*/
public static String getDefaultIpAddresses(ConnectivityManager cm) {
LinkProperties prop = cm.getActiveLinkProperties();
return formatIpAddresses(prop);
}
private static String formatIpAddresses(LinkProperties prop) {
if (prop == null) return null;
Iterator<InetAddress> iter = prop.getAllAddresses().iterator();
// If there are no entries, return null
if (!iter.hasNext()) return null;
// Concatenate all available addresses, comma separated
String addresses = "";
while (iter.hasNext()) {
addresses += iter.next().getHostAddress();
if (iter.hasNext()) addresses += "\n";
}
return addresses;
}
(&amp; npm安装和清理平台)
我们在此讨论过:https://github.com/NativeScript/nativescript-dev-webpack/issues/559#issuecomment-396279840
这已经解决了。