Could not find gradle wrapper within Android SDK

2020-01-20 04:41发布

问题:

i am new in Ionic. I added android platform in my ionic application and tried to run the application in real android device but i am getting following error in my command prompt i am using windows 10 machine on my end.

Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: C:\Users\CURRENT_USER\AppData\Local\Android\sdk\tools\templates\gradle\wrapper

following are my environment variables:

ANDROID_HOME=C:\Users\CURRENT_USER\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files (x86)\java\jdk1.8.0_121

Please suggest

回答1:

I think you need to update android sdk,

First you update your android sdk atleast API LEVEL 19 & tools & extra options as follow

& make sure to add sdk url in environment variable



回答2:

New Android Studio has moved gradle wrapper to C:\Program Files\Android\Android Studio\plugins\android\lib\templates\gradle\wrapper. I copied the templates\ folder to sdk\, then passed the compilation. However the command "Ionic emulate android" still failed with "Error: cmd: Command failed with exit code 1". I don't know how to go further :(