We are happy to announce that we have just released Cordova Android 9.0.0! This is one of Cordova's supported platforms for building Android mobile applications.
To upgrade:
cordova platform remove android cordova platform add android@9.0.0
Added Kotlin Support
Kotlin is one of the newest statically typed languages for developing Android apps. It is designed to work fully with the existing language, Java.
By default, Cordova has Kotlin disabled but it can be enabled with the GradlePluginKotlinEnabled preference in config.xml.
Additionally, Kotlin’s coding style and version are configurable. By default, Cordova sets the coding style as official and uses version 1.3.50.
Below is an example config.xml for enabling and configuring Kotlin.
<preference name="GradlePluginKotlinEnabled" value="true" /> <preference name="GradlePluginKotlinCodeStyle" value="official" /> <preference name="GradlePluginKotlinVersion" value="1.3.50" />
For plugin developers, it is recommended to ensure that the Kotlin files are placed into the platforms src/main/kotlin directory.
Added AndroidX Support
AndroidX is the new and improved namespace for the Android Support Libraries. The original support libraries are no longer maintained.
It is recommended to use AndroidX so that your app is running the latest support libraries but, by default, Cordova has AndroidX support disabled for compatibility with existing plugins.
A lot of the Android supported plugins are still using the old support libraries which can not build when using the AndroidX support libraries. It is recommended to research each plugin to see if they support AndroidX before enabling this feature.
It is recommended for plugin developers to start migrating to support AndroidX. App developers could also use Jetifier to automatically migrates their existing third-party libraries to use AndroidX.
You can enable this feature by setting the AndroidXEnabled preference to true in config.xml.
<preference name="AndroidXEnabled" value="true" />
If you were previously using the cordova-plugin-androidx plugin to enable AndroidX support, this plugin is no longer needed with this preference flag.
The cordova-plugin-androidx-adapter plugin can be used to migrate the legacy references to the new AndroidX references.
Added Google Services Support
To use Google APIs or Firebase services, the Gradle plugin Google Services is required to be enabled when building your Android application.
For plugin developers, this can be enabled by setting to the app's config.xml the GradlePluginGoogleServicesEnabled preference flag. From the plugin.xml file, you can do this by adding the following lines:
<config-file target="config.xml" parent="/*"> <preference name="GradlePluginGoogleServicesEnabled" value="true" /> <preference name="GradlePluginGoogleServicesVersion" value="4.2.0" /> </config-file>
Android Version Support Update
NOTE: because Cordova has increased the minimum SDK version to 22, we no longer support or test with Android 5.0 or lower.
Gradle and Gradle Plugin Version Support Update
Please report any issues you find at issues.cordova.io!
devDependenciesapp/build.gradlelegacy/build.gradle from templatewait_for_boot waiting foreverdetectArchitecture() timeoutANDROID_SDK_ROOT variablecom.android.tools.build:gradle:3.5.3package-lock.jsonpackage.jsonREADME to reflect what Android requires more accurately, which is Java 8, not anything less, not anything greater. Java 1.8.x is required.compare-func with native sort methodrewired filescordova-eslintshelljs dependencyandroid-targetSdkVersiongradle to 6.1 & gradle build tools to 3.5.3.project file & add .settings to gitignoredoFindLatestInstalledBuildToolsBuildConfigpreference optionsversion-compare library to compare build-tools versions properly.q modulesuperspawn & child_process with execajasmine to 3.5.0