TypeError:com.telerik.widget.calendar.RadCalendarView不是构造函数

时间:2018-03-29 17:30:10

标签: nativescript nativescript-telerik-ui

我正在使用带有Typescript的Nativescript Core,当我尝试在页面上使用日历小部件时出现此错误:

<Page xmlns="http://www.nativescript.org/tns.xsd" xmlns:calendar="nativescript-ui-calendar" loaded="onLoaded" actionBarHidden="true">
    <ScrollView>
        <DockLayout>
            <StackLayout dock="top" backgroundColor="#f2f2f2" padding="15">
                ...
                
                <calendar:RadCalendar id="calendar" />
                
                ...
            </StackLayout>            
        </DockLayout>        
    </ScrollView>
</Page>

如果我删除

<calendar:RadCalendar id="calendar" />

页面正确加载。

以下是我的package.json

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "someapp",
    "tns-ios": {
      "version": "3.4.1"
    },
    "tns-android": {
      "version": "3.4.2"
    }
  },
  "dependencies": {
    "moment": "2.20.1",
    "nativescript-appversion": "1.4.1",
    "nativescript-email": "1.5.1",
    "nativescript-exit": "1.0.1",
    "nativescript-fingerprint-auth": "5.1.0",
    "nativescript-iqkeyboardmanager": "1.2.0",
    "nativescript-loading-indicator": "2.4.0",
    "nativescript-pdf-view": "2.0.1",
    "nativescript-phone": "1.3.1",
    "nativescript-theme-core": "1.0.4",
    "nativescript-ui-calendar": "^3.5.1",
    "nativescript-zendesk": "0.3.4",
    "nativescript-zendesk-with-chat": "0.2.0",
    "tns-core-modules": "3.4.0"
  },
  "devDependencies": {
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "0.5.1",
    "tns-platform-declarations": "^3.4.0",
    "typescript": "2.5.3"
  }
}

只是尝试,我从页面中删除了所有内容并将日历放在根目录下,但我也遇到了同样的错误。

有关如何解决此问题的任何想法?

谢谢。

1 个答案:

答案 0 :(得分:0)

好的,事实证明删除和添加平台(android)修复了问题。我最初只是在添加插件后卸载并安装了我的测试设备上的应用程序,但我想这还不够。