# Ionic cordova run android is failing

**URL:** <https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194>\
**Category:** ionic-v3\
**Created:** [August 30, 2018, 6:21am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194 "2018-08-30T06:21:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 6:21am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/1 "2018-08-30T06:21:24Z")

</div>

Hello,

i am trying to run ionic cordova run android but i always fails. here is the exception details:  
 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/b/9/b99125637a4aba50378cb9ff18088f9d5b070005.png)

here is the ionic info details:

 ![ionic%20info](https://global.discourse-cdn.com/ionicframework/original/3X/7/7/772758c8416a9cb2ae994cae4be29f207d6cd415.png)

please help.

Thanks

---

<div class="post-metadata">

**Author:** ![yashwanth493](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@yashwanth493](https://forum.ionicframework.com/u/yashwanth493)\
**Post date:** [August 30, 2018, 6:26am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/2 "2018-08-30T06:26:43Z")

</div>

what is your installed gradle version?

---

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 7:59am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/3 "2018-08-30T07:59:46Z")

</div>

here is the gradle version details:

* * *

## Gradle 4.10

Build time: 2018-08-27 18:35:06 UTC  
Revision: ee3751ed9f2034effc1f0072c2b2ee74b5dce67d

Kotlin DSL: 1.0-rc-3  
Kotlin: 1.2.60  
Groovy: 2.4.15  
Ant: Apache Ant™ version 1.9.11 compiled on March 23 2018  
JVM: 1.8.0\_181 (Oracle Corporation 25.181-b13)  
OS: Windows 10 10.0 amd64

Thanks.

---

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 8:18am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/4 "2018-08-30T08:18:10Z")

</div>

Sorry for the late reply, as my account was on hold.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 30, 2018, 8:23am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/5 "2018-08-30T08:23:01Z")

</div>

Your Cordova tooling seems to be out of date - current `cordova-android` is `7.1.1` - which might be causing all kinds of problems. You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: [https://ionic.zone/cordova/update](https://ionic.zone/cordova/update)

Also, your error message indicates a problem reading some JSON file. Does that ring a bell?

---

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 9:06am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/6 "2018-08-30T09:06:10Z")

</div>

Thanks for your reply. i have updated the android platform but still getting the same json exception. not able to figure out which json file it is.

this is my build.gradle under cordovaLib folder:

```auto

ext {
    apply from: 'cordova.gradle'
    cdvCompileSdkVersion = privateHelpers.getProjectTarget()
    cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
}

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
    }
}

**apply plugin: 'com.android.library'**
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

group = 'org.apache.cordova'
version = '7.1.1'

android {
    compileSdkVersion cdvCompileSdkVersion
    buildToolsVersion cdvBuildToolsVersion
    publishNonDefault true

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
    }
}

install {
    repositories.mavenInstaller {
        pom {
            project {
                packaging 'aar'
                name 'Cordova'
                url 'https://cordova.apache.org'
                licenses {
                    license {
                        name 'The Apache Software License, Version 2.0'
                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }
                developers {
                    developer {
                        id 'stevengill'
                        name 'Steve Gill'
                    }
                }
                scm {
                    connection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
                    developerConnection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
                    url 'https://git-wip-us.apache.org/repos/asf?p=cordova-android'

                }
            }
        }
    }
}

task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

artifacts {
    archives sourcesJar
}

bintray {
    user = System.getenv('BINTRAY_USER')
    key = System.getenv('BINTRAY_KEY')
    configurations = ['archives']
    pkg {
        repo = 'maven'
        name = 'cordova-android'
        userOrg = 'cordova'
        licenses = ['Apache-2.0']
        vcsUrl = 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
        websiteUrl = 'https://cordova.apache.org'
        issueTrackerUrl = 'https://issues.apache.org/jira/browse/CB'
        publicDownloadNumbers = true
        licenses = ['Apache-2.0']
        labels = ['android', 'cordova', 'phonegap']
        version {
            name = '7.1.1'
            released = new Date()
            vcsTag = '7.1.1'
        }
    }
}

```

bold line is line number 40 which is indicated in the exception. also i have attached my android.json under Platforms\>Android folder.

```auto
{
  "prepare_queue": {
    "installed": [],
    "uninstalled": []
  },
  "config_munge": {
    "files": {
      "res/xml/config.xml": {
        "parents": {
          "/*": [
            {
              "xml": "<feature name=\"Camera\"><param name=\"android-package\" value=\"org.apache.cordova.camera.CameraLauncher\" /></feature>",
              "count": 1
            },
            {
              "xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
              "count": 1
            },
            {
              "xml": "<feature name=\"SplashScreen\"><param name=\"android-package\" value=\"org.apache.cordova.splashscreen.SplashScreen\" /><param name=\"onload\" value=\"true\" /></feature>",
              "count": 1
            },
            {
              "xml": "<feature name=\"Whitelist\"><param name=\"android-package\" value=\"org.apache.cordova.whitelist.WhitelistPlugin\" /><param name=\"onload\" value=\"true\" /></feature>",
              "count": 1
            }
          ]
        }
      },
      "AndroidManifest.xml": {
        "parents": {
          "/*": [
            {
              "xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
              "count": 1
            }
          ],
          "application": [
            {
              "xml": "<provider android:authorities=\"${applicationId}.provider\" android:exported=\"false\" android:grantUriPermissions=\"true\" android:name=\"org.apache.cordova.camera.FileProvider\"><meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/camera_provider_paths\" /></provider>",
              "count": 1
            }
          ]
        }
      },
      "config.xml": {
        "parents": {
          "/*": [
            {
              "xml": "<feature name=\"Keyboard\"><param name=\"android-package\" onload=\"true\" value=\"io.ionic.keyboard.IonicKeyboard\" /></feature>",
              "count": 1
            },
            {
              "xml": "<allow-navigation href=\"http://localhost:8080/*\" />",
              "count": 1
            },
            {
              "xml": "<preference name=\"webView\" value=\"com.ionicframework.cordova.webview.IonicWebViewEngine\" />",
              "count": 1
            },
            {
              "xml": "<feature name=\"IonicWebView\"><param name=\"android-package\" value=\"com.ionicframework.cordova.webview.IonicWebView\" /></feature>",
              "count": 1
            }
          ]
        }
      }
    }
  },
  "installed_plugins": {
    "cordova-plugin-camera": {
      "PACKAGE_NAME": "io.ionic.starter"
    },
    "cordova-plugin-device": {
      "PACKAGE_NAME": "io.ionic.starter"
    },
    "cordova-plugin-ionic-keyboard": {
      "PACKAGE_NAME": "io.ionic.starter"
    },
    "cordova-plugin-ionic-webview": {
      "PACKAGE_NAME": "io.ionic.starter"
    },
    "cordova-plugin-splashscreen": {
      "PACKAGE_NAME": "io.ionic.starter"
    },
    "cordova-plugin-whitelist": {
      "PACKAGE_NAME": "io.ionic.starter"
    }
  },
  "dependent_plugins": {},
  "modules": [
    {
      "id": "cordova-plugin-camera.Camera",
      "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
      "pluginId": "cordova-plugin-camera",
      "clobbers": [
        "Camera"
      ]
    },
    {
      "id": "cordova-plugin-camera.CameraPopoverOptions",
      "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
      "pluginId": "cordova-plugin-camera",
      "clobbers": [
        "CameraPopoverOptions"
      ]
    },
    {
      "id": "cordova-plugin-camera.camera",
      "file": "plugins/cordova-plugin-camera/www/Camera.js",
      "pluginId": "cordova-plugin-camera",
      "clobbers": [
        "navigator.camera"
      ]
    },
    {
      "id": "cordova-plugin-camera.CameraPopoverHandle",
      "file": "plugins/cordova-plugin-camera/www/CameraPopoverHandle.js",
      "pluginId": "cordova-plugin-camera",
      "clobbers": [
        "CameraPopoverHandle"
      ]
    },
    {
      "id": "cordova-plugin-device.device",
      "file": "plugins/cordova-plugin-device/www/device.js",
      "pluginId": "cordova-plugin-device",
      "clobbers": [
        "device"
      ]
    },
    {
      "id": "cordova-plugin-ionic-keyboard.keyboard",
      "file": "plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js",
      "pluginId": "cordova-plugin-ionic-keyboard",
      "clobbers": [
        "window.Keyboard"
      ]
    },
    {
      "id": "cordova-plugin-ionic-webview.IonicWebView",
      "file": "plugins/cordova-plugin-ionic-webview/src/www/util.js",
      "pluginId": "cordova-plugin-ionic-webview",
      "clobbers": [
        "Ionic.WebView"
      ]
    },
    {
      "id": "cordova-plugin-splashscreen.SplashScreen",
      "file": "plugins/cordova-plugin-splashscreen/www/splashscreen.js",
      "pluginId": "cordova-plugin-splashscreen",
      "clobbers": [
        "navigator.splashscreen"
      ]
    }
  ],
  "plugin_metadata": {
    "cordova-plugin-camera": "4.0.3",
    "cordova-plugin-device": "2.0.2",
    "cordova-plugin-ionic-keyboard": "2.1.2",
    "cordova-plugin-ionic-webview": "2.1.0",
    "cordova-plugin-splashscreen": "5.0.2",
    "cordova-plugin-whitelist": "1.3.3"
  }
}

```

Please suggest.

Thanks&Regards.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 30, 2018, 9:15am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/7 "2018-08-30T09:15:19Z")

</div>

Post your `ionic info` again please.

Create a new project with `ionic start`, update it to most recent versions, then try to build that one. Does it work?

---

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 9:23am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/8 "2018-08-30T09:23:59Z")

</div>

here is the ionic info:

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/f/d/fd2645fc7251693f62894a506e9fc842b5f6acc6.png)

will let you know if build works with new project.

Thanks & Regards

---

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 10:24am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/9 "2018-08-30T10:24:14Z")

</div>

Hello Sir,

I am facing the same exception with my new app as well. here i have created a brand new app with ionic start and added latest android platform(7.1.1).

```auto
 cordova run android
Android Studio project detected
ANDROID_HOME=C:\Users\TECHLAP31\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181
studio
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
:wrapper

BUILD SUCCESSFUL in 15s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\CordovaLib\build.gradle' line: 40

* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> com/google/gson/JsonParseException

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 34s
(node:7636) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Build file 'C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\CordovaLib\build.gradle' line: 40

* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> com/google/gson/JsonParseException

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 34s
    at ChildProcess.whenDone (C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>

```

Please suggest.

Thanks & Regards

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 30, 2018, 10:49am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/10 "2018-08-30T10:49:06Z")

</div>

That’s _really_ strange.

Is this the complete output of the command? What command exactly?  
Run the same command with `--verbose` added at the end and post its output.

---

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 10:53am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/11 "2018-08-30T10:53:37Z")

</div>

Hello Sir,

the command i tried is ionic cordova run android

here is the complete output with --verbose switch:

```auto
C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>ionic cordova run android --verbose
  ionic:cli-utils Terminal info: { tty: true, ci: false } +0ms
  ionic:cli-utils CLI global options: { _: ['cordova', 'run', 'android'], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +3ms
  ionic:cli-utils:lib:project Project type from config: Ionic Angular 3 (ionic-angular) +0ms
  ionic:cli-utils Project name: undefined +253ms
  ionic:cli Context: { binPath: 'C:\\Users\\TECHLAP31\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath: 'C:\\Users\\TECHLAP31\\AppData\\Roaming\\npm\\node_modules\\ionic', execPath: 'C:\\My Drive\\Demo\\Mobile App\\IonicApps\\TestApp2', version: '4.1.1' } +0ms
  ionic:cli-utils:lib:integrations:cordova:config Using config.xml: C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\config.xml +0ms
  ionic:cli-utils:lib:hooks Looking for ionic:build:before npm script. +0ms
  ionic:cli-utils:lib:project:ionic-angular:build Looking for ionic:build npm script. +0ms
> ionic-app-scripts build --target cordova --platform android
[16:20:09] ionic-app-scripts 3.2.0
[16:20:09] build dev started ...
[16:20:09] clean started ...
[16:20:09] clean finished in 50 ms
[16:20:09] copy started ...
[16:20:09] deeplinks started ...
[16:20:09] deeplinks finished in 15 ms
[16:20:09] transpile started ...
[16:20:14] transpile finished in 4.31 s
[16:20:14] preprocess started ...
[16:20:14] preprocess finished in 1 ms
[16:20:14] webpack started ...
[16:20:14] copy finished in 4.48 s
[16:20:17] webpack finished in 3.46 s
[16:20:17] sass started ...
[16:20:18] sass finished in 1.20 s
[16:20:18] postprocess started ...
[16:20:18] postprocess finished in 13 ms
[16:20:18] lint started ...
[16:20:18] build dev finished in 9.18 s
[16:20:21] lint finished in 2.58 s
  ionic:cli-utils:lib:hooks Looking for ionic:build:after npm script. +14s
> cordova run android --verbose
No scripts found for hook "before_run".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Android Studio project detected
Checking config.xml for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\app\src\main\res\xml\config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, platforms\android\platform_www] to platforms\android\app\src\main\assets\www
  copy www\assets\fonts\ionicons.eot platforms\android\app\src\main\assets\www\assets\fonts\ionicons.eot (updated file)
  copy www\assets\fonts\ionicons.scss platforms\android\app\src\main\assets\www\assets\fonts\ionicons.scss (updated file)
  copy www\assets\fonts\ionicons.svg platforms\android\app\src\main\assets\www\assets\fonts\ionicons.svg (updated file)
  copy www\assets\fonts\ionicons.ttf platforms\android\app\src\main\assets\www\assets\fonts\ionicons.ttf (updated file)
  copy www\assets\fonts\ionicons.woff platforms\android\app\src\main\assets\www\assets\fonts\ionicons.woff (updated file)
  copy www\assets\fonts\ionicons.woff2 platforms\android\app\src\main\assets\www\assets\fonts\ionicons.woff2 (updated file)
  copy www\assets\fonts\noto-sans-bold.ttf platforms\android\app\src\main\assets\www\assets\fonts\noto-sans-bold.ttf (updated file)
  copy www\assets\fonts\noto-sans-bold.woff platforms\android\app\src\main\assets\www\assets\fonts\noto-sans-bold.woff (updated file)
  copy www\assets\fonts\noto-sans-regular.ttf platforms\android\app\src\main\assets\www\assets\fonts\noto-sans-regular.ttf (updated file)
  copy www\assets\fonts\noto-sans-regular.woff platforms\android\app\src\main\assets\www\assets\fonts\noto-sans-regular.woff (updated file)
  copy www\assets\fonts\noto-sans.scss platforms\android\app\src\main\assets\www\assets\fonts\noto-sans.scss (updated file)
  copy www\assets\fonts\roboto-bold.ttf platforms\android\app\src\main\assets\www\assets\fonts\roboto-bold.ttf (updated file)
  copy www\assets\fonts\roboto-bold.woff platforms\android\app\src\main\assets\www\assets\fonts\roboto-bold.woff (updated file)
  copy www\assets\fonts\roboto-bold.woff2 platforms\android\app\src\main\assets\www\assets\fonts\roboto-bold.woff2 (updated file)
  copy www\assets\fonts\roboto-light.ttf platforms\android\app\src\main\assets\www\assets\fonts\roboto-light.ttf (updated file)
  copy www\assets\fonts\roboto-light.woff platforms\android\app\src\main\assets\www\assets\fonts\roboto-light.woff (updated file)
  copy www\assets\fonts\roboto-light.woff2 platforms\android\app\src\main\assets\www\assets\fonts\roboto-light.woff2 (updated file)
  copy www\assets\fonts\roboto-medium.ttf platforms\android\app\src\main\assets\www\assets\fonts\roboto-medium.ttf (updated file)
  copy www\assets\fonts\roboto-medium.woff platforms\android\app\src\main\assets\www\assets\fonts\roboto-medium.woff (updated file)
  copy www\assets\fonts\roboto-medium.woff2 platforms\android\app\src\main\assets\www\assets\fonts\roboto-medium.woff2 (updated file)
  copy www\assets\fonts\roboto-regular.ttf platforms\android\app\src\main\assets\www\assets\fonts\roboto-regular.ttf (updated file)
  copy www\assets\fonts\roboto-regular.woff platforms\android\app\src\main\assets\www\assets\fonts\roboto-regular.woff (updated file)
  copy www\assets\fonts\roboto-regular.woff2 platforms\android\app\src\main\assets\www\assets\fonts\roboto-regular.woff2 (updated file)
  copy www\assets\fonts\roboto.scss platforms\android\app\src\main\assets\www\assets\fonts\roboto.scss (updated file)
  copy www\assets\icon\favicon.ico platforms\android\app\src\main\assets\www\assets\icon\favicon.ico (updated file)
  copy www\assets\imgs\logo.png platforms\android\app\src\main\assets\www\assets\imgs\logo.png (updated file)
  copy www\build\main.css platforms\android\app\src\main\assets\www\build\main.css (updated file)
  copy www\build\main.css.map platforms\android\app\src\main\assets\www\build\main.css.map (updated file)
  copy www\build\main.js platforms\android\app\src\main\assets\www\build\main.js (updated file)
  copy www\build\main.js.map platforms\android\app\src\main\assets\www\build\main.js.map (updated file)
  copy www\build\polyfills.js platforms\android\app\src\main\assets\www\build\polyfills.js (updated file)
  copy www\build\sw-toolbox.js platforms\android\app\src\main\assets\www\build\sw-toolbox.js (updated file)
  copy www\build\vendor.js platforms\android\app\src\main\assets\www\build\vendor.js (updated file)
  copy www\build\vendor.js.map platforms\android\app\src\main\assets\www\build\vendor.js.map (updated file)
  copy www\index.html platforms\android\app\src\main\assets\www\index.html (updated file)
  copy www\manifest.json platforms\android\app\src\main\assets\www\manifest.json (updated file)
  copy www\service-worker.js platforms\android\app\src\main\assets\www\service-worker.js (updated file)
Wrote out android application name "TestApp2" to C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\app\src\main\res\values\strings.xml
android-versionCode not found in config.xml. Generating a code based on version in config.xml (0.0.1): 1
Wrote out Android package name "io.ionic.starter" to C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\app\src\main\java\io\ionic\starter\MainActivity.java
Updating icons at platforms\android\app\src\main\res
Updating splash screens at platforms\android\app\src\main\res
This app does not have additional resource files defined
Prepared android project successfully
No scripts found for hook "after_prepare".
ANDROID_HOME=C:\Users\TECHLAP31\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181
studio
Subproject Path: CordovaLib
Subproject Path: app
Running command: cmd "/s /c ""C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\gradlew.bat" cdvBuildDebug -b "C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m""

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>if "Windows_NT" == "Windows_NT" setlocal

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set DIRNAME=C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>if "C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\" == "" set DIRNAME=.

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set APP_BASE_NAME=gradlew

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set APP_HOME=C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set DEFAULT_JVM_OPTS=

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>if defined JAVA_HOME goto findJavaFromJavaHome

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set JAVA_EXE=C:\Program Files\Java\jdk1.8.0_181/bin/java.exe

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>if exist "C:\Program Files\Java\jdk1.8.0_181/bin/java.exe" goto init

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>if not "Windows_NT" == "Windows_NT" goto win9xME_args

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set CMD_LINE_ARGS=

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set _SKIP=2

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>if "xcdvBuildDebug" == "x" goto execute

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set CMD_LINE_ARGS=cdvBuildDebug -b "C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>set CLASSPATH=C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\\gradle\wrapper\gradle-wrapper.jar

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>"C:\Program Files\Java\jdk1.8.0_181/bin/java.exe" "-Dorg.gradle.appname=gradlew" -classpath "C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\\gradle\wrapper\gradle-wrapper.jar" org.gradle.wrapper.GradleWrapperMain cdvBuildDebug -b "C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\CordovaLib\build.gradle' line: 40

* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> com/google/gson/JsonParseException

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>if "1" == "0" goto mainEnd

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>rem the _cmd.exe /c_ return code!

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>if not "" == "" exit 1

C:\My Drive\Demo\Mobile App\IonicApps\TestApp2>exit /b 1
(node:11532) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Build file 'C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\CordovaLib\build.gradle' line: 40

* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> com/google/gson/JsonParseException

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
    at ChildProcess.whenDone (C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:11532) 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)
Command finished with error code 1: cmd /s /c ""C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\gradlew.bat" cdvBuildDebug -b "C:\My Drive\Demo\Mobile App\IonicApps\TestApp2\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m"
  ionic:cli-utils:lib:shell Error in subprocess stdout pipe: Error: write after end at writeAfterEnd (_stream_writable.js:236:12) at Object.Writable.write (_stream_writable.js:287:5) at Readable.write (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:855:33) at DestroyableTransform.ondata (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:619:20) at emitOne (events.js:116:13) at DestroyableTransform.emit (events.js:211:7) at addChunk (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:291:12) at readableAddChunk (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:278:11) at DestroyableTransform.Readable.push (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:245:10) at DestroyableTransform.Transform.push (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_transform.js:148:32) +0ms
  ionic:cli-utils:lib:shell Error in subprocess stderr pipe: Error: write after end at writeAfterEnd (_stream_writable.js:236:12) at Object.Writable.write (_stream_writable.js:287:5) at Readable.write (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:855:33) at DestroyableTransform.ondata (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:619:20) at emitOne (events.js:116:13) at DestroyableTransform.emit (events.js:211:7) at addChunk (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:291:12) at readableAddChunk (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:278:11) at DestroyableTransform.Readable.push (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_readable.js:245:10) at DestroyableTransform.Transform.push (C:\Users\TECHLAP31\AppData\Roaming\npm\node_modules\ionic\node_modules\readable-stream\lib\_stream_transform.js:148:32) +3ms

```

Thanks for your effort.

Regards.

---

<div class="post-metadata">

**Author:** ![bilow](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bilow](https://forum.ionicframework.com/u/bilow)\
**Post date:** [August 30, 2018, 11:09am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/12 "2018-08-30T11:09:52Z")

</div>

I also get ‘gradle’ errors sometimes. This is what I do to solve that:

1. Close all applications you’re using (Better to reboot; this clears running processes faster who may be using the files you’re going to delete)
2. In your user folder ( C:\Users\XXX\ ) there is a folder called .gradle. Delete the whole folder.
3. Start Android Studio and create/open a random (empty) project.
4. You’ll notice down in the status bar that the IDE is downloading and/or installing gradle stuff. Wait for it to finish.

Go back to your Ionic project  
5. Delete the **platforms** , **plugins** and **www** folder (optionally **node\_modules** folder too)  
6. Execute `ionic cordova run android` again. Accept when CLI is asking for downloading node\_modules etc.

Hope this helps…

---

<div class="post-metadata">

**Author:** ![Kyrax80](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@Kyrax80](https://forum.ionicframework.com/u/Kyrax80)\
**Post date:** [August 30, 2018, 11:14am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/13 "2018-08-30T11:14:33Z")

</div>

Are you using any Native Plugin? This sometimes happens when a plugin isn’t compatible with the Android version you’re trying to use

---

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 11:35am UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/14 "2018-08-30T11:35:05Z")

</div>

Hello Sir,

i can see the android studio is downloading gradle 4.4-all where as gradle -v command shows gradle version as 4.10. can this be an issue?

Regards,  
Deepak

---

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 12:00pm UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/15 "2018-08-30T12:00:15Z")

</div>

Hello Sir,

i am not using any native plugin, just created a new app and trying to run ionic cordova run android command.

Regards.

---

<div class="post-metadata">

**Author:** ![jorgster](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jorgster](https://forum.ionicframework.com/u/jorgster)\
**Post date:** [August 30, 2018, 12:15pm UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/16 "2018-08-30T12:15:03Z")

</div>

Try downgrading to Cordova7.1.0, if you’re using Cordova8.0.0.

---

<div class="post-metadata">

**Author:** ![deepak97kumar](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deepak97kumar](https://forum.ionicframework.com/u/deepak97kumar)\
**Post date:** [August 30, 2018, 12:17pm UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/17 "2018-08-30T12:17:43Z")

</div>

Thanks a lot it solved the issue.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 30, 2018, 12:17pm UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/18 "2018-08-30T12:17:48Z")

</div>

> [@jorgster](#):
>
> Try downgrading to Cordova7.1.0, if you’re using Cordova8.0.0.

Why should changing a global CLI have any effect on what a local platform is doing?

---

<div class="post-metadata">

**Author:** ![jorgster](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jorgster](https://forum.ionicframework.com/u/jorgster)\
**Post date:** [August 30, 2018, 12:18pm UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/19 "2018-08-30T12:18:12Z")

</div>

I have no idea, but it worked for me.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:18pm UTC](https://forum.ionicframework.com/t/ionic-cordova-run-android-is-failing/140194/20 "2021-07-19T21:18:19Z")

</div>


