0

Estoy tratando de emular una app en android:
1º Voy a la carpeta donde tengo mi proyecto, para ello escribo en mi línea de comandos cd rutademiproyecto
2º Escribo los siguientes comandos:

  • ionic cordova platform add android
  • ionic cordova build android
  • ionic cordova emulate android

Después de que se haya finalizado el procesamiento de la última sentencia de la anterior lista de sentencias, no veo por ningún lado una ventana con una emulación de android. ¿Ya que se supone que debería aparecerme una ventana con el sistema operativo android, no?
Estoy siguiendo este tutorial, y ahí veo que se aparece una ventanta para el sistema operativo ios, el minuto 5:50. No sé si mi problema tiene algo que ver con uno de los mensajes que me lanza Ionic a través de la consola, en concreto con este:

CordovaError: No emulator images (avds) found.

Por si sirve de algo a continuación escribo todos los mensajes que me lanza Ionic através de la consola cuando escribo ionic cordova emulate android:

Running app-scripts build: --platform android --target cordova [21:08:04] build dev started ... [21:08:08] clean started ... [21:08:09] clean finished in 836 ms [21:08:09] copy started ... [21:08:12] deeplinks started ... [21:08:12] deeplinks finished in 131 ms [21:08:12] transpile started ... [21:09:19] transpile finished in 66.93 s [21:09:19] preprocess started ... [21:09:19] preprocess finished in 1 ms [21:09:19] webpack started ... [21:09:22] copy finished in 72.92 s [21:09:41] webpack finished in 22.57 s [21:09:41] 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 w
arning. [21:09:56] sass finished in 14.85 s [21:09:56] postprocess started ... [21:09:57] postprocess finished in 497 ms [21:09:57] lint started ... [21:09:57] build dev finished in 112.93 s

cordova emulate android [21:10:02] lint finished in 5.79 s Android Studio project detected

ANDROID_HOME=C:\android-sdk-windows JAVA_HOME=C:\Program Files\Java\jdk1.8.0_161 studio Subproject Path: CordovaLib Subproject Path: app Starting a Gradle Daemon (subsequent builds will be faster) 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 re
moved in Gradle 5.0. Please use Task.doLast(Action) instead. at build_c43z9qtayi62ulxyg0zehvtr5.run(C:\RedditApp\platforms\android\ap p\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

: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

:app:assembleDebug

:app:cdvBuildDebug

BUILD SUCCESSFUL in 1m 8s 46 actionable tasks: 3 executed, 43 up-to-date Built the following apk(s): C:\RedditApp\platforms\android\app\build\outputs\apk\debug\app-debug.apk

ANDROID_HOME=C:\android-sdk-windows JAVA_HOME=C:\Program Files\Java\jdk1.8.0_161 (node:6996) UnhandledPromiseRejectionWarning: CordovaError: No emulator images (
avds) found. 1. Download desired System Image by running: "C:\android-sdk-windows\tools\andro
id.bat" sdk 2. Create an AVD by running: "C:\android-sdk-windows\tools\android.bat" avd HINT: For a faster emulator, use an Intel System Image and install the HAXM devi
ce driver

at C:\RedditApp\platforms\android\cordova\lib\emulator.js:288:29
at _fulfilled (C:\RedditApp\platforms\android\cordova\node_modules\q\q.js:85        

4:54) at self.promiseDispatch.done (C:\RedditApp\platforms\android\cordova\node_mo
dules\q\q.js:883:30) at Promise.promise.promiseDispatch (C:\RedditApp\platforms\android\cordova\n
ode_modules\q\q.js:816:13) at C:\RedditApp\platforms\android\cordova\node_modules\q\q.js:624:44 at runSingle (C:\RedditApp\platforms\android\cordova\node_modules\q\q.js:137
:13) at flush (C:\RedditApp\platforms\android\cordova\node_modules\q\q.js:125:13) at process._tickCallback (internal/process/next_tick.js:176:11) (node:6996) 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) (node:6996) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.

[OK] Your app has been deployed. Did you know you can live-reload changes from your app with --livereload?

1
  • Tener en cuenta que debe estar el relacionamosVistas(); para que el proyecto aparezca en el emulador.
    – user386603
    Commented el 4 sept. a las 20:48

1 respuesta 1

0

Antes de intentar emular en ionic, abre android studio, te creas un proyecto en blanco. Ve a la pestaña Tools > AVD Manager. Cuando lo tengas abierto le das a Create virtual device. Yo tengo 2 virtual devices: un Pixel y una tablet Pixel para emular las apps en Tablet y mobil. Una vez hayas hecho esto, debería funcionarte ya sin ese error.

Básicamente lo que pasa es que al intentar ejecutar el emulador no encuentra una maquina virtual en la que "deployear".

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.