Reputation: 21862
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?
Upvotes: 4
Views: 457
Reputation: 12826
You can use the android update project
command to create a build.xml
file that cordova's ant will like. If the subproject has a lot of dependencies that maven resolves, then you may end up with a multi step build where you resolve the dependencies of the subproject first then do the cordova build.
More details about the sub project would help.
Upvotes: 2