Cordova: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable

后端 未结 8 630
太阳男子
太阳男子 2020-12-01 05:00

I am having problem to build android with Cordova, when I execute cordova build android, I receive this error:

Error: Android SDK not found. Ma         


        
相关标签:
8条回答
  • 2020-12-01 05:52

    For me this work , first check your cordova android version

    cordova platform version android
    

    it shows 5.0 to me and after that upgrade the version by this command

    cordova platform update android
    
    0 讨论(0)
  • 2020-12-01 05:56

    The recent Android SDK tools removed the android command.

    $ android -v
    The android command is no longer available.
    For manual SDK and AVD management, please use Android Studio.
    For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
    

    cordova is behind the change and someone seems to be working on it: https://issues.apache.org/jira/browse/CB-12554

    You can also downgrade your tools to a version where the android was still available.

    Nevertheless, I found a way to run the Android app without having to downgrade my SDK tools. I would (1) run cordova prepare, then (2) run the command I need from Android Studio. In my case, running it on the emulator was enough.

    UPDATE: The issue CB-12554 is resolved now and was released with the cordova-android@6.2.0 release.

    UPDATE: There were several related subsequent patches done and the newest version is cordova-android@6.2.3. Run cordova platform rm android; cordova platform add android@6.2.3 to fix the issues.

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