Cordova: You may not have the required environment or OS to run this project

后端 未结 12 2070
半阙折子戏
半阙折子戏 2020-12-10 04:24

On Linux Mint 17.1 x86_64, Cordova v4.3.0 gives this error:

$ cordova run android

Running command: /home/naman/test/platforms/android/cordova/run 
WARNING :         


        
相关标签:
12条回答
  • 2020-12-10 04:52

    Your android sdk doesn't seem to be properly installed or you didn't install the proper android sdk version that has the dependency that you seem to be missing

    /opt/software/android-sdk/tools/tools/lib/build.template
    
    0 讨论(0)
  • 2020-12-10 04:52

    I encountered this issue now too. The problem in my case is that the ant.properties file that I'm using is pointed to wrong and NOT existing file.

    key.store=D:/Fedmich/_keys/android.keystore
    

    After correcting it, I was able to compile a release apk. Hope this helps someone in the future. Just be sure to read the error_logs that is given in the command prompt.

    0 讨论(0)
  • 2020-12-10 04:55

    I got this error after installing the Crosswalk plugin. To solve it I installed the latest Android SDK, deleted the android folder under platforms and ran

    phonegap build android

    alternatively

    cordova platform add --save android

    cordova build android

    and it was all good.

    0 讨论(0)
  • 2020-12-10 04:55
    export ANDROID_HOME=/Applications/adt-bundle-mac-x86_64-20140321/sdk
    export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
    

    then cordova run android works

    0 讨论(0)
  • 2020-12-10 04:58

    Make sure you have proper environment variables defined (add this in .bash_login or .profile and do source .profile):

    export ANDROID_SDK="/opt/software/android-sdk"
    export ANDROID_NDK="/opt/software/android-ndk"
    export ANDROID_HOME="$ANDROID_SDK"
    export ANDROID_PLATFORM_TOOLS="$ANDROID_SDK/platform-tools"
    export PATH="${PATH}:$ANDROID_HOME/tools:$ANDROID_PLATFORM_TOOLS"
    
    0 讨论(0)
  • 2020-12-10 05:01

    For others having this problem, assuming you have already checked and fixed any environment variables using @Naman Dixit's answer, you may also have to remove and add your platforms:

    cmd:  cordova platform rm [platform(s) of interest]
    

    delete everything in the [yourproject]/platforms folder. Then:

    cmd:  cordova platform add [platform(s) of interest]
    

    that was the final step I needed to get everything to work

    0 讨论(0)
提交回复
热议问题