# Error with emulate

**URL:** <https://forum.ionicframework.com/t/error-with-emulate/109926>\
**Category:** ionic-v3\
**Created:** [October 25, 2017, 12:13pm UTC](https://forum.ionicframework.com/t/error-with-emulate/109926 "2017-10-25T12:13:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![godefroid](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@godefroid](https://forum.ionicframework.com/u/godefroid)\
**Post date:** [October 25, 2017, 12:13pm UTC](https://forum.ionicframework.com/t/error-with-emulate/109926/1 "2017-10-25T12:13:30Z")

</div>

Hi I just create a blank project I didn’t change anything,  
I add platform android, and when I run the command  
ionic cordova emulate android I get this message  
[ERROR] An error occurred while running cordova emulate android (exit code 1).

All the messages on the terminal are

```auto
Running app-scripts build: --platform android --target cordova
[07:55:12] build dev started ... 
[07:55:13] clean started ... 
[07:55:13] clean finished in 3 ms 
[07:55:13] copy started ... 
[07:55:13] deeplinks started ... 
[07:55:13] deeplinks finished in 19 ms 
[07:55:13] transpile started ... 
[07:55:15] transpile finished in 2.33 s 
[07:55:15] preprocess started ... 
[07:55:15] preprocess finished in less than 1 ms 
[07:55:15] webpack started ... 
[07:55:15] copy finished in 2.46 s 
[07:55:22] webpack finished in 7.43 s 
[07:55:22] sass started ... 
[07:55:23] sass finished in 985 ms 
[07:55:23] postprocess started ... 
[07:55:23] postprocess finished in 7 ms 
[07:55:23] lint started ... 
[07:55:23] build dev finished in 10.88 s 
> cordova emulate android
[07:55:26] lint finished in 2.36 s 
ANDROID_HOME=/Users/gillesgodefroid/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
Starting a Gradle Daemon (subsequent builds will be faster)

:wrapper

BUILD SUCCESSFUL

Total time: 8.299 secs
Subproject Path: CordovaLib
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
	at build_8kqdndo9vqvve12axgld7tbu6.run(/Users/gillesgodefroid/Documents/Ionic2Do/platforms/android/build.gradle:141)
Download https://jcenter.bintray.com/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.pom

Download https://jcenter.bintray.com/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar

The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.

Incremental java compilation is an incubating feature.

The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.

:preBuild
 
UP-TO-DATE
:preDebugBuild
 UP-TO-DATE
:checkDebugManifest

:CordovaLib:preBuild
 
UP-TO-DATE
:CordovaLib:preDebugBuild
 
UP-TO-DATE
:CordovaLib:checkDebugManifest

:CordovaLib:prepareDebugDependencies

:CordovaLib:compileDebugAidl

:CordovaLib:compileDebugNdk
 
UP-TO-DATE
:CordovaLib:compileLint

:CordovaLib:copyDebugLint
 UP-TO-DATE
:CordovaLib:mergeDebugShaders

:CordovaLib:compileDebugShaders

:CordovaLib:generateDebugAssets

:CordovaLib:mergeDebugAssets

:CordovaLib:mergeDebugProguardFiles

:CordovaLib:packageDebugRenderscript
 
UP-TO-DATE
:CordovaLib:compileDebugRenderscript

:CordovaLib:generateDebugResValues

:CordovaLib:generateDebugResources

:CordovaLib:packageDebugResources

:CordovaLib:processDebugManifest

:CordovaLib:generateDebugBuildConfig

:CordovaLib:processDebugResources

:CordovaLib:generateDebugSources

:CordovaLib:incrementalDebugJavaCompilationSafeguard

:CordovaLib:compileDebugJavaWithJavac

:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes
 UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug

:CordovaLib:mergeDebugJniLibFolders

:CordovaLib:transformNative_libsWithMergeJniLibsForDebug

:CordovaLib:transformNative_libsWithSyncJniLibsForDebug

:CordovaLib:bundleDebug

:prepareOrgApacheCordovaCordovaLib630DebugLibrary

:prepareDebugDependencies

:compileDebugAidl

:compileDebugRenderscript

:generateDebugBuildConfig

:generateDebugResValues

:generateDebugResources

:mergeDebugResources

:processDebugManifest

:processDebugResources

:generateDebugSources
:incrementalDebugJavaCompilationSafeguard

:compileDebugJavaWithJavac

:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:compileDebugNdk
 UP-TO-DATE
:compileDebugSources
:mergeDebugShaders

:compileDebugShaders

:generateDebugAssets

:mergeDebugAssets

:transformClassesWithDexForDebug

:mergeDebugJniLibFolders

:transformNative_libsWithMergeJniLibsForDebug

:processDebugJavaRes
 
UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug

:validateSigningDebug

:packageDebug

:assembleDebug

:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 38.614 secs
Built the following apk(s): 
	/Users/gillesgodefroid/Documents/Ionic2Do/platforms/android/build/outputs/apk/android-debug.apk

ANDROID_HOME=/Users/gillesgodefroid/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
Error: Cannot read property 'replace' of undefined

[ERROR] An error occurred while running cordova emulate android (exit code 1).

```

the ionic info is

cli packages: (/usr/local/lib/node\_modules)

```
@ionic/cli-utils : 1.15.0
ionic (Ionic CLI) : 3.15.0

```

global packages:

```
cordova (Cordova CLI) : 7.1.0 

```

local packages:

```
@ionic/app-scripts : 3.0.1
Cordova Platforms : android 6.3.0 ios 4.5.2
Ionic Framework : ionic-angular 3.7.1

```

System:

```
ios-sim : 6.1.2 
Node : v8.7.0
npm : 5.4.2 
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004 

```

Environment Variables:

```
ANDROID_HOME : not set

```

Misc:

```
backend : pro
```

---

<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:** [October 25, 2017, 3:16pm UTC](https://forum.ionicframework.com/t/error-with-emulate/109926/2 "2017-10-25T15:16:40Z")

</div>

Is `ionic cordova requirements` happy?

---

<div class="post-metadata">

**Author:** ![godefroid](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@godefroid](https://forum.ionicframework.com/u/godefroid)\
**Post date:** [October 25, 2017, 3:29pm UTC](https://forum.ionicframework.com/t/error-with-emulate/109926/3 "2017-10-25T15:29:38Z")

</div>

What do you mean ?  
Cordova seems running well

---

<div class="post-metadata">

**Author:** ![godefroid](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@godefroid](https://forum.ionicframework.com/u/godefroid)\
**Post date:** [October 25, 2017, 3:37pm UTC](https://forum.ionicframework.com/t/error-with-emulate/109926/4 "2017-10-25T15:37:05Z")

</div>

ionic cordova requirements results

```auto
> cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23

Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-3.2/bin/gradle

Requirements check results for ios:
Apple macOS: installed darwin

Xcode: installed [object Object]
ios-deploy: not installed 
ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy'

CocoaPods: installed [object Object]
Error: Some of requirements check failed

```

---

<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:** [October 25, 2017, 3:43pm UTC](https://forum.ionicframework.com/t/error-with-emulate/109926/5 "2017-10-25T15:43:17Z")

</div>

> [@godefroid](#):
>
> cordova emulate android

That’s what I meant 🙂

Can you run `ionic cordova emulate android --verbose` and `cordova emulate android --debug` to see if you get additional output in the error message?

What are your emulators called? Check in the AVD Manager in Android Studio and run `ionic cordova emulate android --list`.

---

<div class="post-metadata">

**Author:** ![godefroid](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@godefroid](https://forum.ionicframework.com/u/godefroid)\
**Post date:** [October 25, 2017, 5:56pm UTC](https://forum.ionicframework.com/t/error-with-emulate/109926/6 "2017-10-25T17:56:57Z")

</div>

my emulators called are : Nexus\_5\_API\_26 and Nexus\_6\_API\_23.

Besides I get the same error message when I run the commands you asked.  
Do you want all the message ?

---

<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:** [October 25, 2017, 6:26pm UTC](https://forum.ionicframework.com/t/error-with-emulate/109926/7 "2017-10-25T18:26:17Z")

</div>

Nah, if its identical they are no use. Was hoping for additional output what file was breaking…

I am pretty much out of ideas, sorry.

As it also happens with `cordova ...` you might report it at [issues.cordova.io](http://issues.cordova.io). It is a Cordova problem.

---

<div class="post-metadata">

**Author:** ![godefroid](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@godefroid](https://forum.ionicframework.com/u/godefroid)\
**Post date:** [October 25, 2017, 6:54pm UTC](https://forum.ionicframework.com/t/error-with-emulate/109926/8 "2017-10-25T18:54:34Z")

</div>

Thank you, I did it.

regards

Gilles
