cordova requirements fails for android in mac

366 Views Asked by At

I tried Cordova android setup in mac.

added android platform using following command

cordova platform add android@latest

but when i issue cordova requirements it fails with following error.

Android Studio project detected

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed 
No android targets (SDKs) installed!
Gradle: installed /usr/local/Cellar/gradle/4.9/bin/gradle

Requirements check results for ios:
Apple macOS: installed darwin
Xcode: installed [object Object]
ios-deploy: installed [object Object]
CocoaPods: installed [object Object]
(node:85492) UnhandledPromiseRejectionWarning: CordovaError: Some of requirements check failed
    at /usr/local/lib/node_modules/cordova/src/cli.js:414:27
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:108:17)
    at process._tickCallback (internal/process/next_tick.js:61:11)
(node:85492) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:85492) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

i have latest cordova and android sdk (it just have tools folder alone).

run and build works perfectly for ios but it fails for android. Can you please help me to fix this. Thanks in advance.

1

There are 1 best solutions below

0
On BEST ANSWER

it worked after installing android version 27 & 26 from android studio.