androidcordovaibm-mobilefirstmobilefirst-adaptersmobilefirst-server

Cant get rid of this error. I'm trying to build a mobile first app using cordova. Error: You must be in a MobileFirst project to execute this command


Cant seem to follow the tutorials for building apps with Mobile first and cordova. i used mfp cordova create to create an app and named it Idealaketest.

Enter name of app: Idealaketest

Enter the package ID: com.ibm.Idealaketest

have progressed on as far as the code below. Please help with a workaround or a link to a page with appropriate tuts. I'm following this at the moment.

https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/hello-world/integrating-mfpf-sdk-in-cordova-applications/

D:\Mobilefirst_workspaces\workspace3>mfp cordova create
? Enter name of app: Idealaketest
? Enter the package ID: com.ibm.Idealaketest
? Enter the app version: 1.0.0
? Select platforms to be supported by your app: android
? The following plugins will be automatically added to your app:
cordova-plugin-mfp
org.apache.cordova.device
org.apache.cordova.dialogs
org.apache.cordova.geolocation
org.apache.cordova.globalization
org.apache.cordova.inappbrowser
org.apache.cordova.network-information

Please press enter to continue...
? Select additional plugins you would like to add:
? Enter a path to an app template to be added: cordova-hello-world-mfp
Embedded Cordova Command: cordova create "Idealaketest" "com.ibm.Idealaketest" "
Idealaketest" --copy-from="C:\Program Files\IBM\MobileFirst-CLI\mobilefirst-cli\
node_modules\cordovacmd\cordova\templates\cordova-hello-world-mfp"
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.ibm.Idealaketest
        Name: Idealaketest
        Android target: android-22
Copying template files...
Project successfully created.
Adding "cordova-plugin-mfp"
Installing "cordova-plugin-mfp" for android
Installing "org.apache.cordova.device" for android
Installing "org.apache.cordova.dialogs" for android
Installing "org.apache.cordova.geolocation" for android
Installing "org.apache.cordova.globalization" for android
Installing "org.apache.cordova.inappbrowser" for android
Installing "org.apache.cordova.network-information" for android
Plugin install completed
CordovaApp.java was renamed to MainActivity.original, if you made manual changes
 to CordovaApp.java, you need to merge them with the current main activity file,
 CordovaApp.java, in /platforms/android/src/[package_path]
Plugin "cordova-plugin-mfp" added successfully.
Preparing for push...
MFP App settings not found, configuring..
Embedded Cordova Command: cordova prepare android
D:\Mobilefirst_workspaces\workspace3\Idealaketest\mobilefirst\com_ibm_Idealakete
st-android-1.0.0.wlapp has been built.
Push Completed Successfully.
MFP Cordova project created successfully.

D:\Mobilefirst_workspaces\workspace3>mfp start
Cannot find the server configuration. Creating a new MobileFirst test server.
The development server is being created.
The development server has been successfully created with the following informat
ion:
Server Directory: C:/Users/guest/.ibm/mobilefirst/7.1.0.00.20160307-2032/server
/
URL: http://localhost:10080/
Error: You must be in a MobileFirst project to execute this command.

D:\Mobilefirst_workspaces\workspace3>cd Idealaketest

D:\Mobilefirst_workspaces\workspace3\Idealaketest>mfp start
Error: You must be in a MobileFirst project to execute this command.

D:\Mobilefirst_workspaces\workspace3\Idealaketest>mfp cordova preview
? Select how to preview your app: browser: Simple browser rendering
Preparing for push...
Verifying Server Configuration...
Error: There are no runtimes available on this server.
Run 'mfp help intro' for guidance.
Error: error code: 305
Error: There was an error with the server.
Error: MASTERPUSHSERVERFAILED
Error: Push has failed

Solution

  • You didn't a project...

    Create the project:

    mfp create myproj
    cd myproj
    mfp start

    Create the Cordova project:

    cd ..
    mfp cordova create myapp
    cd myapp
    mfp cordova platform add android
    mfp push
    mfp cordova run