susan
susan

Reputation: 53

Error while building phonegap android app using cli Win7

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

Upvotes: 2

Views: 1459

Answers (1)

Naresh Kumar
Naresh Kumar

Reputation: 938

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.

Upvotes: 2

Related Questions