Search code examples
nativescriptnativescript-telerik-ui

TypeError: com.telerik.widget.calendar.RadCalendarView is not a constructor


I am using Nativescript Core with Typescript and I get this error when I try to use the calendar widget on the page:

<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>

If I remove

<calendar:RadCalendar id="calendar" />

the page loads properly.

Below is my 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"
  }
}

Just to try, I removed everything from the page and placed the calendar at the root, but I got the same error.

Any ideas on how to resolve this issue?

Thank you.


Solution

  • Ok, it turns out that removing and adding back the platform (android) fixed the issue. I originally, just uninstalled and installed back the app on my test device after adding the plugin, but I guess this was not enough.