Search code examples
androidcordovacommand-line-interfaceibm-mobilefirst

Creating a Cordova project with MobileFirst CLI, fails to run Android command


When I run the mfp Cordova create command, I get an error message that says it failed to run the Android command. I have installed the latest Android SDK, set the ANDROID_HOME to the Android Studio location, and added the path to the android.bat file to the PATH variable, but still getting this error. In the project directory that is created, some of the default artefacts are created, but some are missing. The application-descriptor.xml file and mobilefirst directory are missing.


Solution

  • In my ~/.bash_profile I have the following set:

    #export ANDROID_HOME="/Users/idanadar/Documents/MobileFirst/Setup/Android/"
    #export ANDROID_ROOT="/Users/idanadar/Documents/MobileFirst/Setup/Android/platform-tools/"

    Then in Terminal I did: mfp cordova create, followed the interactive instructions, added the Android environment and was able to successfully create it.

    In the project folder I have application-descriptor.xml at the root folder, and a mobilefirst folder with wlapp files for -android, -ios and -all.