Configure the Target Apache Cordova Version

Filter by IDE
Select the AppBuilder client you are currently using for development.

IDE

When a new target version of Apache Cordova becomes available in AppBuilder, you can quickly update to the new version of Apache Cordova and continue development. You can also downgrade to a supported Apache Cordova version.

When a minor update to an existing target version becomes available (for example, a security update), AppBuilder automatically makes sure that your app uses the latest available implementation of the target framework version.

Migrating from Apache Cordova 2.x to Apache Cordova 3.x and later applies the following changes to the plugins in your app.

  • The migration exposes the configurable core plugin architecture in the AppBuilder user interface.
  • All core plugins are enabled.
  • You cannot enable the ChildBrowser plugin.
  • If you have enabled the ChildBrowser plugin in AppBuilder 1.9 or later, AppBuilder disables it and you will not be able to build with it.
  • If you have enabled one or more of the integrated plugins in AppBuilder 1.8 or earlier, AppBuilder identifies and handles them as custom plugins. You need to manage such integrated plugins as custom plugins.
  • AppBuilder updates any integrated plugins to the version required to work with the target Apache Cordova version. You might need to modify your code manually in case of newly introduced, modified or deprecated plugin functionality.
  • You might need to modify the plugin.xml files for your custom plugin.

    • You can declare the plugin script file in a <js-module> element instead of an <asset> element.
    • You might need to switch from mapping the plugin in a <plugin> element to mapping it in a <feature> element.

      For example:

      Apache Cordova 2.x:
      
      <config-file target="res/xml/config.xml" parent="plugins">
          <plugin name="CustomCordovaPlugin" value="com.custom.plugin.CustomCordovaPlugin"/>
      </config-file>
      
      Apache Cordova 3.x:
      
      <config-file target="res/xml/config.xml" parent="widget">
          <feature name="CustomCordovaPlugin"> <!-- Map the plugin to the native APIs. -->
              <param name="ios-package" value="com.custom.plugin.CustomCordovaPlugin" />
          </feature>
      </config-file>
      
  • You might need to update the custom plugin code to be compatible with Apache Cordova 3.x.
  • You might not be able to build and apps which use custom plugins.

Migrating from Apache Cordova 3.x to Apache Cordova 3.x and later applies the following changes to the plugins in your app.

  • The migration updates all core and integrated plugins to match the current Apache Cordova version.
  • The migration uninstalls the verified plugins and you need to manually install them for the newly set Apache Cordova target version.
  • The migration to Apache Cordova 4.x makes the Telerik Analytics, Telerik Mobile Testing and Telerik AppFeedback plugins available as verified plugins. For more information about how to add the plugins to apps that target Apache Cordova 4.0.0 or later, see Enable Analytics in Your App, Working with Mobile Testing or Enable Feedback in Your App, respectively.
  • The migration does not update or remove custom plugins in your app. You need to verify that any custom plugins build and work as expected.

IMPORTANT: Changing the target Apache Cordova version does not apply the necessary code changes to address possible breaking changes in the Apache Cordova APIs. Always make sure to review the changelogs for the Apache Cordova version to which you want to migrate and address breaking changes in the APIs inside your code.

Prerequisites

  • Verify that your preferred AppBuilder client is running and you are logged in.
  • Verify that you have opened the code for your app in AppBuilder.

Procedure

In-Browser

  1. In the Project Navigator, double-click Properties.
  2. Navigate to the General tab, if needed.
  3. From the Cordova Version drop-down menu, select the version that you want to target.
  4. Wait for the operation to complete.
    Migrating to Apache Cordova 4.0.0 or later enables the Whitelist core plugin for Android. This plugin implements a whitelist policy for your current web view. For more information about the Whitelist plugin, see the GitHub repository of the plugin and the Apache Cordova Whitelist Guide.
  5. Close the properties dialog.

Universal

  1. In the Project Navigator, double-click Properties.
  2. Navigate to the General tab, if needed.
  3. From the Cordova Version drop-down menu, select the version that you want to target.
  4. Wait for the operation to complete.
    Migrating to Apache Cordova 4.0.0 or later enables the Whitelist core plugin for Android. This plugin implements a whitelist policy for your current web view. For more information about the Whitelist plugin, see the GitHub repository of the plugin and the Apache Cordova Whitelist Guide.
  5. Close the properties dialog.

Windows

  1. In the Project Navigator, double-click Properties.
  2. Navigate to the General tab, if needed.
  3. From the Cordova Version drop-down menu, select the version that you want to target.
  4. Save your changes.
    Migrating to Apache Cordova 4.0.0 or later enables the Whitelist core plugin for Android. This plugin implements a whitelist policy for your current web view. For more information about the Whitelist plugin, see the GitHub repository of the plugin and the Apache Cordova Whitelist Guide.
  5. Close the dialog.

Visual Studio

  1. In the Solution Explorer, double-click Properties.
  2. Navigate to the General tab, if needed.
  3. From the Cordova Version drop-down menu, select the version that you want to target.
  4. Save your changes.
  5. If the Plugins tab is marked as modified, save your changes again.
    Migrating to Apache Cordova 4.0.0 or later enables the Whitelist core plugin for Android. This plugin implements a whitelist policy for your current web view. For more information about the Whitelist plugin, see the GitHub repository of the plugin and the Apache Cordova Whitelist Guide.
  6. Close the dialog.

CLI

  1. In the command prompt, navigate to the directory that contains your app.
  2. To print the current target framework version for your app, run the following command.

    appbuilder mobileframework
    

    This operation also lists the available framework versions.

  3. To change the target framework version for your app, run the following command.

    appbuilder mobileframework set <Version>
    

    <Version> is a valid target framework version as listed in Step 2.

Migrating to Apache Cordova 4.0.0 or later enables the Whitelist core plugin for Android. This plugin implements a whitelist policy for your current web view. For more information about the Whitelist plugin, see the GitHub repository of the plugin and the Apache Cordova Whitelist Guide.

Next Steps

Address any breaking changes in the Apache Cordova APIs and run your app on device. If you have already deployed your app on device, you need to re-deploy it for the configuration changes to take effect.

See Also

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.