Error with emulate


#1

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

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

#2

Is ionic cordova requirements happy?


#3

What do you mean ?
Cordova seems running well


#4

ionic cordova requirements results

> 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

#5

That’s what I meant :slight_smile:

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.


#6

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 ?


#7

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. It is a Cordova problem.


#8

Thank you, I did it.

regards

Gilles