Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Build Android platform with Ant

Peter Bakondy edited this page Mar 16, 2016 · 1 revision

Building Android project with Ant will fail

$ cordova create testsim
Creating a new cordova project.

$ cd testsim/

$ cordova plugin add cordova-plugin-sim
Fetching plugin "cordova-plugin-sim" via npm

$ cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
  Path: platforms/android
  Package: io.cordova.hellocordova
  Name: HelloCordova
  Activity: MainActivity
  Android target: android-23
Android project created with [email protected]
Installing "cordova-plugin-sim" for android
Installing "cordova-plugin-whitelist" for android

$ cordova build android -- --ant
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home
ERROR building one of the platforms: Project contains at least one plugin that requires a system library. This is not supported with ANT. Please build using gradle.
You may not have the required environment or OS to build this project
Error: Project contains at least one plugin that requires a system library. This is not supported with ANT. Please build using gradle.

How to fix this issue

Remove system library not supported with ANT

  • open file plugins/cordova-plugin-sim/plugin.xml
  • remove the <framework> tag from section <platform name="android"> (line 29)
  • save file and close

Add required jar file

$ cordova plugin add cordova-plugin-android-support-v4-jar

Build again

$ cordova platform rm android
$ cordova platform add android
$ cordova build android -- --ant
Clone this wiki locally