Error while attempting to use "cordova build" on an Android project with sub-project references

Viewed 450

I just upgraded my Apache Cordova project to Cordova 3.2 and changed everything to a cordova CLI project at the same time. It was all working fine until, in my Android app, I added a reference to another, third-party project. The Android app still works fine with that sub-project, however, now when I try to run "cordova build" from the command line I get the following error:

Preparing android project
Compiling app on platform "android" via command "/<path-to-my-cordova-project>/platforms/android/cordova/build" 
[Error: An error occurred while building the android project.Error executing "ant clean -f /<path-to-my-cordova-project>/platforms/android/build.xml": 
BUILD FAILED
/Applications/adt-bundle-mac-x86_64/sdk/tools/ant/build.xml:471: Invalid file: /<path-to-my-android-sub-project>/build.xml

The Android sub-project uses maven, rather than ant, so there is no build.xml file. But Cordova wants one to exist, for some reason… I tried placing a dummy build.xml file in the sub-project, but Cordova doesn't like that either.

I know that typically Cordova projects don't have sub-projects, since all of the app code is typically just html/javascript/css. So, is the concept of a sub-project simply something that the Cordova CLI doesn't support yet? Is there a way I can get the CLI to just ignore the sub-project?

1 Answers
Related