android


ionic 3 cli 'ionic cordova run android' command throws an error


I updated the cli to ionic 3 version and when i run
ionic cordova run android
to build apk file and run in android emulator I got this error
C:\Users\XXXX\Desktop\beep>ionic cordova run android
Running app-scripts build: --address 0.0.0.0 --port 8100 --p 8100 --livereload-port 35729 --r 35729 --iscordovaserve --externalIpRequired --nobrowser
[20:52:20] build dev started ...
[20:52:20] clean started ...
[20:52:20] clean finished in 11 ms
[20:52:20] copy started ...
[20:52:20] transpile started ...
[20:52:22] transpile finished in 2.53 s
[20:52:22] preprocess started ...
[20:52:22] deeplinks started ...
[20:52:23] deeplinks finished in 52 ms
[20:52:23] preprocess finished in 54 ms
[20:52:23] webpack started ...
[20:52:23] copy finished in 2.77 s
[20:52:31] webpack finished in 8.53 s
[20:52:31] sass started ...
[20:52:32] sass finished in 1.11 s
[20:52:32] postprocess started ...
[20:52:32] postprocess finished in 7 ms
[20:52:32] lint started ...
[20:52:32] build dev finished in 12.29 s
> cordova run android
ANDROID_HOME=C:\Users\XXXX\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_101
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova run android (exit code 1).
what I already tried to do and it not helps:
1. removed android studio and install again.
2. run these commands
cordova platform rm android
cordova platform add android
npm cache clear
update the sdk in android studio
nothing really helps to solve this issue.
add the location of Android Studio's Gradle (e.g, /usr/local/android-studio/gradle/gradle-3.2/bin for linux) to your PATH environment variable
that's how I solve this issue.
download gradle latest version bin file this link link to download gradle
extract the winzip file into java folder (e.g C:\Program Files\Java\jdk1.8.0_101\gradle-3.5)
go to my computer right click -> properties.
then go to advanced system setting in left side menu.
advances -> environment Variables then select Path.
add new environment variable called %GRADLE_HOME%/bin

Related Links

expand background of action bar menuItem to height of actionbar
Different drawable based on build variant in Gradle
How to open other application from widget in android? [duplicate]
Android: Relationship between minSdkVersion and targetSdkVersion
Can't convert drawable resource to file
NEW Google Drive Android API - Metadata of unfinished file prematurely available
Android widget: download and parse JSON and write it to TextView on user click
Closing the Handler, removing callbacks, cannot kill Activity
What to put in OnPause to balance out what is in OnResume
Enlarging an Imageview on click
ListView not always displaying values
Pass a string variable from an activity into a fragment
How to alternate the color from a Textview which is being update in Android?
Swipe not detected on Android 4.4 in jquery mobile Cordova project
Aandroi: display text over camerapreview
how to port a project built in eclipse into a phonegap build project?

Categories

HOME
android
go
adal
string
object
pclxl
google-cloud-functions
yandex
carousel
3d-reconstruction
code-coverage
pcl-crypto
github-enterprise
watson-conversation
siddhi
why3
libc
favicon
shared-libraries
html5-appcache
foreign-keys
cfml
selinux
breadth-first-search
poedit
blade
visual-studio-extensions
qliksense
data.stackexchange.com
surveymonkey
jquery-multiselect
corpus
intersystems-cache
inversion-of-control
sinch
quantlib
tizen-tv
corenlp-server
scrollview
utorrent
hibernate-validator
fstream
card.io
apiary.io
docfx
jpad
cd
metawidget
mongoose-schema
tasm
android-softkeyboard
portforwarding
file-sharing
signal-strength
stylecop
procfile
libjpeg
mouseleave
cpu-cache
android-instrumentation
donations
smartfoxserver
autosar
vulcanize
adafruit
httpruntime.cache
avisynth
ember-cli-rails
teamcity-9.1
zend-currency
user-permissions
bcache
procedural-programming
infosphere-spl
machine-instruction
imagefilter
human-computer-interface
ss7
dct
gnumeric
vsx
renderer
authlogic
vbe
drupal-nodes
android-audiorecord
gwt-openlayers
ora-06550
mbunit
process-explorer
fb.ui
patricia-trie
sentestingkit
garbage
subproject
window-decoration
ilasm
role
msr
cloudfiles
drupal-fivestar
strtod
mathematical-notation
sifr3
information-management
contentpresenter

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App