"Hello World" Ionic Cordova doesn't start on Android Emulator

I’ve a problem when I try to start my Hello World App on an Android Emulator.
With

ionic cordova run android or ionic cordova emulate android

In console I’ve the successful build but, when the Android Emulator starts, there’s only a white screen and I’ve this error:

emulator: ERROR: detected a hanging thread 'Qt event loop'. No response for 15091 ms

Here’s the complete output:

C:\ionic\helloworld>ionic cordova emulate android

Running app-scripts build: --platform android --target cordova
[10:19:35]  build dev started ...
[10:19:35]  clean started ...
[10:19:35]  clean finished in 173 ms
[10:19:35]  copy started ...
[10:19:35]  deeplinks started ...
[10:19:35]  deeplinks finished in 42 ms
[10:19:35]  transpile started ...
[10:20:04]  transpile finished in 28.92 s
[10:20:04]  preprocess started ...
[10:20:04]  preprocess finished in 1 ms
[10:20:04]  webpack started ...
[10:20:09]  copy finished in 34.00 s
[10:20:24]  webpack finished in 19.85 s
[10:20:24]  sass started ...
Without `from` option PostCSS could generate wrong source map and will not find
Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[10:20:33]  sass finished in 8.27 s
[10:20:33]  postprocess started ...
[10:20:33]  postprocess finished in 46 ms
[10:20:33]  lint started ...
[10:20:33]  build dev finished in 57.80 s
> cordova emulate android
[10:20:42]  lint finished in 9.30 s
Android Studio project detected

ANDROID_HOME=C:\Users\f.menghini\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_151
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now
published.

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_4pfxhr798qcgzup57qy4uywxt.run(C:\ionic\helloworld\platforms\android\app\build.gradle:143)
:CordovaLib:preBuild
 UP-TO-DATE
:CordovaLib:preDebugBuild
 UP-TO-DATE
:CordovaLib:compileDebugAidl
 UP-TO-DATE
:CordovaLib:compileDebugRenderscript
 UP-TO-DATE

:CordovaLib:checkDebugManifest
 UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar
 UP-TO-DATE
:CordovaLib:generateDebugResValues

UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources
 UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processDebugManifest

UP-TO-DATE
:CordovaLib:processDebugResources
 UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:javaPreCompileDebug UP-TO-DATE

:CordovaLib:compileDebugJavaWithJavac
 UP-TO-DATE
:CordovaLib:processDebugJavaRes
 NO-SOURCE

:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
:app:preBuild UP-TO-DATE
:app:preDebugBuild

UP-TO-DATE
:app:compileDebugAidl
 UP-TO-DATE
:CordovaLib:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript
 UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar
UP-TO-DATE
:app:generateDebugResValues
 UP-TO-DATE

:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
 UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest
 UP-TO-DATE

:app:splitsDiscoveryTaskDebug UP-TO-DATE

:app:processDebugResources
 UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:javaPreCompileDebug
 UP-TO-DATE
:app:compileDebugJavaWithJavac
 UP-TO-DATE
:app:compileDebugNdk
 NO-SOURCE
:app:compileDebugSources UP-TO-DATE
:CordovaLib:mergeDebugShaders
 UP-TO-DATE
:CordovaLib:compileDebugShaders
 UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets
 UP-TO-DATE
:app:mergeDebugShaders
 UP-TO-DATE
:app:compileDebugShaders
 UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
 UP-TO-DATE
:app:extractTryWithResourcesSupportJarDebug UP-TO-DATE
:app:transformClassesWithStackFramesFixerForDebug UP-TO-DATE
:app:transformClassesWithDesugarForDebug
 UP-TO-DATE
:app:transformClassesWithDexBuilderForDebug
 UP-TO-DATE
:app:transformDexArchiveWithExternalLibsDexMergerForDebug

UP-TO-DATE
:app:transformDexArchiveWithDexMergerForDebug
 UP-TO-DATE
:CordovaLib:compileDebugNdk
 NO-SOURCE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug
 UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNativeLibsWithMergeJniLibsForDebug
 UP-TO-DATE
:app:processDebugJavaRes
NO-SOURCE
:app:transformResourcesWithMergeJavaResForDebug

UP-TO-DATE
:app:validateSigningDebug

:app:packageDebug
 UP-TO-DATE
:app:assembleDebug

UP-TO-DATE
:app:cdvBuildDebug UP-TO-DATE

BUILD SUCCESSFUL in 1m 24s
47 actionable tasks: 1 executed, 46 up-to-date
Built the following apk(s):
        C:\ionic\helloworld\platforms\android\app\build\outputs\apk\debug\app-debug.apk

ANDROID_HOME=C:\Users\f.menghini\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_151
No emulator specified, defaulting to Nexus_6_API_26
Waiting for emulator to start...

emulator: WARNING: Crash service did not start

emulator: Requested console port 5584: Inferring adb port 5585.
emulator: WARNING: Not all modern X86 virtualization features supported, which introduces problems with slowdown when running Android on multicore vCPUs. 
Setting AVD to run with 1 vCPU core only.
Hax is enabled
Hax ram_size 0x60000000
HAX is working and emulator runs in fast virt mode.
emulator: ERROR: detected a hanging thread 'Qt event loop'. No response for 15091 ms

How can I resolve this trouble?
Thank you so much :slight_smile:

What is your ionic info output?
What does ionic cordova requirements return?

Can you start an emulator manually in Android Studio?
You might try to install Genymotion and use that emulator.

1 Like

ionic info output is:

cli packages: (C:\Users\f.menghini\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v9.4.0
    npm               : 5.6.0
    OS                : Windows 7

Environment Variables:

    ANDROID_HOME : C:\Users\f.menghini\AppData\Local\Android\Sdk

Misc:

    backend : pro

and

ionic cordova requirements output is:

Requirements check results for android:

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-27,android-26

Gradle: installed C:\Program Files\Android\Android Studio\gradle\gradle-4.1\bin\
gradle

Requirements check results for ios:
Apple macOS: not installed
Cordova tooling for iOS requires Apple macOS
Error: Some of requirements check failed

Yes, I can launch manually the AVD trough Android Studio and it works, and it works also in a Genymotion Emulator.
But I don’t understand why the Emulator launched from the prompt cannot run the app :disappointed_relieved::disappointed_relieved::disappointed_relieved:

The error message

sounds more like the emulator can not run at all when started from there.

Maybe delete and reinstall it?

1 Like

You mean delete and reinstall the emulator created in Android Studio or delete and reinstall Android Studio?
Because the emulator that I’m trying to launch is created in Android Studio.

Yes, remove and re-add the AVD.

1 Like

I’ve the same result, the emulator is launched but nothing happen inside, only a white screen :frowning:

Does it first normally launch Android and then only white in the app?

Then:
Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android Look at the console and network tabs for errors.

If not: Sorry, I am out of ideas.

The emulator is black as soon as it starts, then upward it launch a pop-up with “performing clean boot: snapshot don’t exist”, then popup disappear andthe screen becomes white.

In console I’ve this output now:

glClear:466 GL err
 0x502
Error: Failed to execute shell command "getprop,dev.bootcomplete"" on device: Error: C:\Users\f.menghini\AppData\Local\Android\Sdk\platform-tools\adb.exe: 
Command failed with exit code 1 Error output:
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.

compileAndValidateCoreShader: fail to compile. infolog Fragment shader failed to
 compile with the following errors:
ERROR: 0:85: error(#143) Undeclared identifier undefined
ERROR: 0:85: error(#132) Syntax error: '<' parse error
ERROR: error(#273) 2 compilation errors.  No code generated

linkAndValidateProgram: fail to link program. 
infolog: Fragment shader(s) were not successfully compiled before glLinkProgram() was called.  
Link failed.

compileAndValidateCoreShader: fail to compile. infolog Fragment shader failed to compile with the following errors:
ERROR: 0:85: error(#143) Undeclared identifier undefined
ERROR: 0:85: error(#132) Syntax error: '<' parse error
ERROR: error(#273) 2 compilation errors.  No code generated

linkAndValidateProgram: fail to link program. infolog: Fragment shader(s) were not successfully compiled before glLinkProgram() was called.  Link failed.

compileAndValidateCoreSh
ader: fail to compile. infolog Fragment shader failed to compile with the follow
ing errors:
ERROR: 0:85: error(#143) Undeclared identifier undefined
ERROR: 0:85: error(#132) Syntax error: '<' parse error
ERROR: error(#273) 2 compilation errors.  No code generated

linkAndValidateProgram: fail to link program. infolog: Fragment shader(s) were not successfully compiled before glLinkProgram() was called.  L
ink failed.