I've been using nativescript-telerik-ui-pro and it's working ok on my first project.
BUT, on any other projects, I get an error. It seems like it can't find the framework.
Here are the steps to reproduce:
tns create bugDemo --tsc
cat package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.bugDemo"
},
"dependencies": {
"nativescript-theme-core": "~1.0.2",
"tns-core-modules": "rc"
},
"devDependencies": {
"nativescript-dev-android-snapshot": "^0.*.*",
"nativescript-dev-typescript": "~0.4.0",
"typescript": "~2.2.1"
}
}
tns plugin add file:///Users/henriqueMac/Documents/Telerik/UiForNativeScript1.6.1.231/Packages/nativescript-ui-pro.tgz
Successfully installed plugin nativescript-telerik-ui-pro.
cat package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.bugDemo"
},
"dependencies": {
"nativescript-telerik-ui-pro": "file:///Users/henriqueMac/Documents/Telerik/UiForNativeScript1.6.1.231/Packages/nativescript-ui-pro.tgz",
"nativescript-theme-core": "~1.0.2",
"tns-core-modules": "rc"
},
"devDependencies": {
"nativescript-dev-android-snapshot": "^0.*.*",
"nativescript-dev-typescript": "~0.4.0",
"typescript": "~2.2.1"
}
}
// ADD items array to main-view-model.ts
public items: Array<string>;
// add next line to constructor:
this.items = ['Item 1', 'Item 2', 'Item 3']; // just for demo
// Add a RadListView to the xml, so main-page.xml is now:
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page" xmlns:lv="nativescript-telerik-ui-pro/listview">
<Page.actionBar>
<ActionBar title="My App" icon="" class="action-bar">
</ActionBar>
</Page.actionBar>
<StackLayout>
<lv:RadListView row="0" items="{{ items }}" selectionBehavior="Press" itemSelected="onItemSelected" class="menuListView" id="myOrderlistView">
<lv:RadListView.listViewLayout>
<lv:ListViewLinearLayout scrollDirection="Vertical"/>
</lv:RadListView.listViewLayout>
<lv:RadListView.itemTemplate class="my-order-item-template">
<GridLayout columns="auto" rows="auto" class="stylelayout">
<Label row="0" text="Here I am" textWrap="true" class="item-name" />
</GridLayout>
</lv:RadListView.itemTemplate>
</lv:RadListView>
<Label text="Tap the button" class="h1 text-center"/>
<Button text="TAP" tap="{{ onTap }}" class="btn btn-primary btn-active"/>
<Label text="{{ message }}" class="h2 text-center" textWrap="true"/>
</StackLayout>
</Page>
tns build ios
tns run ios
ERROR: (this is on the simulator)
file:///app/tns_modules/tns-core-modules/ui/builder/builder.js:195:56: JS ERROR Error: Building UI from XML. @file:///app/main-page.xml:9:9
> Module '/Users/henriqueMac/Library/Developer/CoreSimulator/Devices/F3C9E401-3616-4043-BA6F-F7CA64C63FDC/data/Containers/Bundle/Application/78BC69E6-E786-49FC-AA1A-3A75D30BBA69/bugDemo.app/app/nativescript-telerik-ui-pro/listview' not found for element 'nativescript-telerik-ui-pro/listview:RadListView'.
> Could not find module '/Users/henriqueMac/Library/Developer/CoreSimulator/Devices/F3C9E401-3616-4043-BA6F-F7CA64C63FDC/data/Containers/Bundle/Application/78BC69E6-E786-49FC-AA1A-3A75D30BBA69/bugDemo.app/app/nativescript-telerik-ui-pro/listview'. Computed path '/Users/henriqueMac/Library/Developer/CoreSimulator/Devices/F3C9E401-3616-4043-BA6F-F7CA64C63FDC/data/Containers/Bundle/Application/78BC69E6-E786-49FC-AA1A-3A75D30BBA69/bugDemo.app/app/nativescript-telerik-ui-pro/listview'.Apr 25 11:47:08 Henriques-MacBook-Pro com.apple.CoreSimulator.SimDevice.F3C9E401-3616-4043-BA6F-F7CA64C63FDC.launchd_sim[80854] (UIKitApplication:org.nativescript.bugDemo[0x7325][20774]): Service exited due to Segmentation fault: 11
All UI for NativeScript pro works on the very first app I've added to, but not on any other ones.
Any ideas on what am I doing wrong?
Thank you!