[SOLVED]Qt 5.1 for Android issue when running app on device(Can't find necessary libs)

  • I installed latest Android-SDK, NDK and Ant.
    I downloaded three Android apis(10,17,18)
    I developed a simple qt app for android

    Below is my deployment tries

    First I tried to deploy api level 10 emulator(app deploys but shows a blank screen )
    Second I tried to deploy api level 17 emulator(app deploys and runs smoothly)
    Third I tried to deploy api level 10 device running android 2.3.6(app deploys but shows blank screen)

    On my third try application output shows:

    E/Qt (14265): Can't create main activity
    E/Qt (14265): java.io.FileNotFoundException: /data/data/org.qtproject.example.sampleapp/lib/lib--Managed_by_Qt_Creator--plugins_platforms_android_libqtforandroid.so (No such file or directory)
    E/Qt (14265): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
    E/Qt (14265): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
    E/Qt (14265): at java.io.FileInputStream.<init>(FileInputStream.java:80)
    E/Qt (14265): at java.io.FileInputStream.<init>(FileInputStream.java:132)
    E/Qt (14265): at org.qtproject.qt5.android.bindings.QtActivity.createBundledBinary(QtActivity.java:366)
    E/Qt (14265): at org.qtproject.qt5.android.bindings.QtActivity.extractBundledPluginsAndImports(QtActivity.java:386)
    E/Qt (14265): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:436)

    What is problem? How can I solve it?

  • I guess Qt is compiling using armeabi-v7a for API10 (and API10 need to be armeabi).

    In apk file, it deploy a dir /lib/armeabi-v7a (that contains .so files). So API10 doesn't load this dir.

    Did you try to check the option "Install Ministro" instead of "Use Qt libraries from device" or "Deploy local Qt libraries"?

  • I installed Ministro and Ministro Config Tool from Google Play. When I run application "Use local Qt libs" option unchecked Ministro detecs there are missing libraries. But In my every try I got "Invalid Qt version" error with Ministro(I am using Qt 5.1 for Android(32-bit) on Windows 7 x64)

    I also tried "Deploy local Qt libraries" option. But my phone internal memory is low. So the app can't run with low memory(I also changed app install location to external)

    If I copy necessary *.so files to SD card manually and set app LIBS path. Does it work?

  • I've got the same issue.

    Qt 5.1 does not come with armv5 binaries, so it's not going to package the right libs for armv5 processors.

    I tried to build my own, but eventually ran into all the problems related to this:

    Long story short, if you want to make an apk for an ARMv5 device, you need Qt binaries built for it. They would be in the /lib/armeabi directory. However, as described in the bug report, it isn't possible to build a set of binaries that will work from the code currently in the repository.

    I did see a post somewhere where someone claimed to have built them successfully. Maybe we can chase down how that was achieved.

  • So I guess we have to buy a new device running higher api level or we have to update our phone with Android 4.x(unofficial solutions)

  • What is your device?

    If it is below armv7, updating to android 4.x also wont help.

  • My device is Samsung Galaxy Ace running Android 2.3.6 version.

    "Device specs":http://www.gsmarena.com/samsung_galaxy_ace_s5830-3724.php

  • https://groups.google.com/forum/#!topic/android-qt/wliNaQnOPyI
    Check out what marco scarpetta said in his 2nd last post, maybe it works for you.

  • The bug has now been marked fixed. Does anyone know how to view the changeset? I'd like to see what was done before building.

    Edit: Looks like the release config has been fixed for the 4.4.3 toolchain ( https://bugreports.qt-project.org/browse/QTBUG-32854 ). Still, I'd like to see the changeset.

  • Above post is very promising.

    I downloaded legacy toolchains for linux-x86 from "here":http://developer.android.com/tools/sdk/ndk/index.html
    and extracted contents of the archieve under <path-to-ndk>/toolchains

    I tried to configure qt with
    @./configure -android-arch armeabi -android-toolchain-version 4.3.3 -android-ndk-host linux-x86 -developer-build -xplatform android-g++ -nomake tests -nomake examples -android-ndk /home/onurozcelik/Android/android-ndk-r9/ -android-sdk /home/onurozcelik/Android/android-sdk-linux/ -skip qttools -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples@

    But it alwasys fails with the error-message:
    Can not detect Android NDK toolchain. Please use -android-toolchain-version to specify

    What is the problem?

  • I figured out the problem

    In configure script I wrote

    @-android-toolchain-version 4.3.3@

    instead of

    @-android-toolchain-version 4.4.3@

    I successfully built Qt 5 for Android armeabi libs and tested a simple app. The app worked.

Log in to reply

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