2

I'm able to launch sdk manager using cli. Updated to Android sdk tools 24.4.1. ANDROID_HOME has been set to C:\Program Files\Android\android-sdk\platform-tools. ant has been installed and added to path. The app gets created but it gets failed to build. And throws an error as shown below. Appreciate your help.

E:\PhoneGapApps\test2>phonegap build android
[phonegap] executing 'cordova platform add --save android'...
[phonegap] completed 'cordova platform add --save android'
[phonegap] executing 'cordova build android'...
cp: no such file or directory: E:\PhoneGapApps\test2\icon.png
ANDROID_HOME=C:\Program Files\Android\android-sdk\platform-tools
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_60
ERROR building one of the platforms: Could not find gradle wrapper within Androi
d SDK. Might need to update your Android SDK.
Looked here: C:\Program Files\Android\android-sdk\platform-tools\tools\templates
\gradle\wrapper
You may not have the required environment or OS to build this project

Error: Could not find gradle wrapper within Android SDK. Might need to update yo
ur Android SDK.
Looked here: C:\Program Files\Android\android-sdk\platform-tools\tools\templates
\gradle\wrapper
susan
  • 53
  • 5

1 Answers1

2

set ANDROID_HOME in system variable as follows

C:\Program Files\Android\android-sdk

And set path in user variale as follows

appropriate jdkpath ; C:\Program Files\Android\android-sdk\tools;C:\Program Files\Android\android-sdk\platform-tools

Hope it will help you.

Naresh Kumar
  • 938
  • 5
  • 12
  • It helped. Thanks a lot. But there is another problem. Even though it shows "completed cordova build android" it doesn't show any folders related to ant inside ..myApp\platforms\android . The apk file should be in the ant-build folder right? – susan Mar 10 '16 at 10:28
  • Naresh, Thanks again. I appreciate your help. I found the apk file under myApp\platforms\android\build\outputs\apk – susan Mar 10 '16 at 10:33
  • Adding `C:\Program Files\Android\android-sdk\tools;C:\Program Files\Android\android-sdk\platform-tools` to the `path` variable was sufficient for me. – Tsunamis Mar 06 '17 at 10:29