Can not run program on Android emulator



  • I use Qt5.2.0. I tried to run my small program on emulator that I launched, but every time Qt Creator launching new copy of emulator, and after new copy was loaded - Creator shooting installation error...



  • Did you get any details about the installation error?



  • For me, I just can't delopy to the emulator at all. I don't know how to define a "compatible device"

    https://dl.dropbox.com/s/2003xf01s4nh92l/no_compatible_device.png



  • I think Qt 5.2.0 has an issue with the latest Android SDK update. But there is a workaround for that. Try this :

    In QtCreator -> Projects -> BuildEnvironment add the variable

    ANDROID_TARGET_ARCH=default/armeabi-v7a

    Then the AVDs are shown as compatible.

    Source:
    http://stackoverflow.com/questions/22238649/qt5-for-android-incompatible-abi



  • Hi, I think there is a bug if you are using the latest android SDK, the AVD names contain a "/" or something and Qt Creator cannot parse it correctly sometimes, there are some other threads about that bug here in the forums maybe do a search.



  • ANDROID_TARGET_ARCH=default/armeabi-v7a

    This works! But I still can't deploy to the emulator. The emulator takes 10 minutes to startup, and then at the end, failed to deploy. If I run again, it starts another emulator.....what the.... I know that might be android SDK's fault as emulator is slow ...and almost unusable.

    Now I'm not hoping to speed up the emulator. I just want to know if you guys know how to connect/deploy to the emulator already there and not starting a new one, wait 10 minutes and end up fail again...



  • I don't think you can with Qt 5.2, maybe you can try the Qt 5.3 beta and see if that bug is fixed or use an older version of the Android SDK :/

    I only debug my apps on an real Android device, that works most of the time at least.. the default Android emulator is quite useless in my opinion.

    Another solution if you have to use the emulator is to deploy the app manually, either with the adb tool or some other way you only have to get the apk file on the "device" somehow
    @
    adb install <path_to_apk>
    @
    if you don't need the live debugger console this might be a workaround for now, at least you can run the app, maybe you manage to connect the debugger to the running app, never tried that myself though.



  • Regarding the slowness of Android Emulator, my suggestion is :

    (1) go to Android SDK Manager and install the following :

    • Intel x86 atom system image
    • Intel x86 Emulator Accelerator HAXM
      (2) on QtCreator, add the "Android for x86" kit to your project (under Project -> Add Kit)
      (3) When building & deploying, create a new AVD (Create Android Virtual Device) and select "x86" as the ABI

    In short : use "armeabi-v7a" ABI when deploying your App to a real Android device and "x86" ABI for emulation.

    Android emulation runs much faster in this manner.

    https://software.intel.com/en-us/android/articles/speeding-up-the-android-emulator-on-intel-architecture



  • Good idea! I'll try that at home tonight ^.^

    Actually I don't have an android phone, planing to buy one!



  • Great info!! Thx!



  • @cezmen yeah that is a good idea in general, but I had only problems with the x86 build and Qt apps. At least I had lots of crashes with QML apps on the x86 Android platform, but the apps run great on ARM architecture, or is that a weird bug!? My app just kept crashing at startup with some weird native error I can't recall atm.
    Anyway I like the HAXM emulator for Android SDK apps written in Java, just saying that I could't not get my app working on the x86 build (without any external libraries other than Qt itself) :(



  • Sounds like the x86 build is buggy or unmaintained



  • You may try Qt 5.3.0 RC, which can be download now from http://download.qt-project.org/snapshots/qt/5.3/.

    It is very likely that it will be much more stable with the latest Android SDK tools version (22.6).

    I currently use Qt 5.2.1 (for Android and iOS) with Android SDK tools 22.3, and the Android Emulator works fine with the x86 ABI.



  • Like x 999


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.