locked
Cannot use the class of Installed Plugin RRS feed

  • Question

  • I'm just tried Apache Cordova today, and I use Visual Studio

    So, I created a project from blank Cordova project template that provided by Microsoft Visual Studio 2015.

    And then I added test plugin (https://github.com/MSOpenTech/cordova-plugin-test) into the project via config.xml > Plugins > Custom > git, it's seems work fine, it show me notification that plugin has been installed.

    However, when I add another custom plugin (I use https://github.com/toluhta/Immersify in this case) and type this code at onDeviceReady():

    Immersify.enable(onImmersiveSuccess, onImmersiveFailed);

    Visual Studio 2015 give me error:

        TS2304    Build: Cannot find name 'Immersify'.
        TS2304    Cannot find name 'Immersify'

    I tried clearing Cordova Cache via Tools > Options > Tools for Apache Cordova > Cordova Tools and running Dependency Checker few times, still no luck

    any ideas?

    • Edited by ChronO2Jam Monday, October 26, 2015 4:25 PM
    Monday, October 26, 2015 3:58 PM

Answers

  • Hi 

    I guess you created the project as a TypeScript Project.

    It means TypeScript does not know about Immersify. You should use corresponding DefinetelyTyped library, or define Immersify yourself like

    var Immersify: any;


    Please mark this as answer if it helps.
    Microsoft Certified Trainer
    Microsoft Certified Professional Developer
    Blog: http://www.EnterpriseApplicationsDevelopment.com/

    • Marked as answer by ChronO2Jam Tuesday, October 27, 2015 12:26 PM
    Tuesday, October 27, 2015 10:19 AM

All replies

  • Hi 

    I guess you created the project as a TypeScript Project.

    It means TypeScript does not know about Immersify. You should use corresponding DefinetelyTyped library, or define Immersify yourself like

    var Immersify: any;


    Please mark this as answer if it helps.
    Microsoft Certified Trainer
    Microsoft Certified Professional Developer
    Blog: http://www.EnterpriseApplicationsDevelopment.com/

    • Marked as answer by ChronO2Jam Tuesday, October 27, 2015 12:26 PM
    Tuesday, October 27, 2015 10:19 AM
  • Hi 

    I guess you created the project as a TypeScript Project.

    It means TypeScript does not know about Immersify. You should use corresponding DefinetelyTyped library, or define Immersify yourself like

    var Immersify: any;


    Please mark this as answer if it helps.
    Microsoft Certified Trainer
    Microsoft Certified Professional Developer
    Blog: http://www.EnterpriseApplicationsDevelopment.com/

    Yes, I created the project as TypeScript project.

    I tried your solution to define the class first before use, but still no luck

    I ended up with recreating project as Javascript project

    Thank you for the information!

    Tuesday, October 27, 2015 12:26 PM