Ion app says it works in Android emulator but doesn't work

I have an Ionic app that I'm trying to run on a Genymotion virtual device. Here's what on my command line after entering the Android ion run command

Updated the hooks directory to have execute permissions Running command: "c:\Program Files (x86)\nodejs\node.exe" c:\Users\username\git\mobile\hooks\after_prepare\010_add_platform_class.js c:/Users/username/git/mobile add to body class: platform-android Running command: c:\Users\username\git\mobile\platforms\android\cordova\run.bat ANDROID_HOME=c:\Program Files (x86)\Android\android-sdk JAVA_HOME=C:\Program Files (x86)\java\jdk1.8.0_45 WARNING: No target specified, deploying to device '192.168.56.101:5555'. Running: c:\Users\username\git\mobile\platforms\android\gradlew cdvBuildDebug -bc:\Users\username\git\mobile\platforms\android\build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=true :preBuild :compileDebugNdk UP-TO-DATE :preDebugBuild :checkDebugManifest :CordovaLib:compileLint :CordovaLib:copyDebugLint UP-TO-DATE :CordovaLib:mergeDebugProguardFiles UP-TO-DATE :CordovaLib:preBuild :CordovaLib:preDebugBuild :CordovaLib:checkDebugManifest :CordovaLib:prepareDebugDependencies :CordovaLib:compileDebugAidl UP-TO-DATE :CordovaLib:compileDebugRenderscript UP-TO-DATE :CordovaLib:generateDebugBuildConfig UP-TO-DATE :CordovaLib:generateDebugAssets UP-TO-DATE :CordovaLib:mergeDebugAssets UP-TO-DATE :CordovaLib:generateDebugResValues UP-TO-DATE :CordovaLib:generateDebugResources UP-TO-DATE :CordovaLib:packageDebugResources UP-TO-DATE :CordovaLib:processDebugManifest UP-TO-DATE :CordovaLib:processDebugResources UP-TO-DATE :CordovaLib:generateDebugSources UP-TO-DATE :CordovaLib:compileDebugJava UP-TO-DATE :CordovaLib:processDebugJavaRes UP-TO-DATE :CordovaLib:packageDebugJar UP-TO-DATE :CordovaLib:compileDebugNdk UP-TO-DATE :CordovaLib:packageDebugJniLibs UP-TO-DATE :CordovaLib:packageDebugLocalJar UP-TO-DATE :CordovaLib:packageDebugRenderscript UP-TO-DATE :CordovaLib:bundleDebug UP-TO-DATE :prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE :prepareDebugDependencies :compileDebugAidl UP-TO-DATE :compileDebugRenderscript UP-TO-DATE :generateDebugBuildConfig UP-TO-DATE :generateDebugAssets UP-TO-DATE :mergeDebugAssets UP-TO-DATE :generateDebugResValues UP-TO-DATE :generateDebugResources UP-TO-DATE :mergeDebugResources UP-TO-DATE :processDebugManifest UP-TO-DATE :processDebugResources UP-TO-DATE :generateDebugSources UP-TO-DATE :compileDebugJava UP-TO-DATE :preDexDebug UP-TO-DATE :dexDebug UP-TO-DATE :processDebugJavaRes UP-TO-DATE :validateDebugSigning :packageDebug UP-TO-DATE :zipalignDebug UP-TO-DATE :assembleDebug UP-TO-DATE :cdvBuildDebug UP-TO-DATE BUILD SUCCESSFUL Total time: 27.114 secs Built the following apk(s): c:\Users\username\git\mobile\platforms\android\build\outputs\apk\android-debug.apk Using apk: c:\Users\username\git\mobile\platforms\android\build\outputs\apk\android-debug.apk Installing app on device... Launching application... LAUNCH SUCCESS 

I should also note that after the commands are completed, a small change occurs on my device. A small menu appears with three options: Wallpaper, Application Management, and System Preferences. However, the application does not start and does not appear in the list of installed applications.

+6
source share
1 answer

This is fixed on its own: it turns out that the type of virtual device was a problem. I used the Google Galaxy Nexus 4.1.1 API 16 device, switching to Google Nexus 4 5.1.0 API 22, fixed it!

+4
source

Source: https://habr.com/ru/post/989540/


All Articles