Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Has anyone succeeded with CrystaX NDK instead of the Google one?
Forum Updated to NodeBB v4.3 + New Features

Has anyone succeeded with CrystaX NDK instead of the Google one?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 2.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndrzejO
    wrote on last edited by
    #1

    Hello All

    I'm trying to port one simple application to android (I don't have much experience with mobile development so it is pure Qt/QtQuick with the hope that it will work :)).

    On desktop (5.8, linux, g++) it compiles and runs just fine.
    When I try to build using android-ndk-r13 then I'm getting errors about missing std::to_string functions. From searching around I've learned that this is a result of "deficiency" of libc shipped on android (lack of support of wide characters) with suggestion to use CrystaX as a replacement (the web page of this NDK claims that it is much more "portable" - in the sense that it should smoothen porting desktop apps to android).

    So I installed this CrystaX NDK pointed QtCreator to it and tried to compile. It nearly was OK since linker complained about missing crystax library so I've added:

    android: QMAKE_LIBDIR += /opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a
    

    to the .pro and compilation succeeded. However when I try to deploy/run (from within QtCreator) I get errors:

    D/dalvikvm( 1532): Trying to load lib /data/data/org.qtproject.example.treadmill/lib/libgnustl_shared.so 0x41b04ff0
    E/linker  ( 1532): load_library(linker.cpp:759): library "libcrystax.so" not found
    E/linker  ( 1532): soinfo_link_image(linker.cpp:1652): could not load library "libcrystax.so" needed by "libgnustl_shared.so"; caused by load_library(linker.cpp:759): library "libcrystax.so" not found
    E/dalvikvm( 1532): dlopen("/data/data/org.qtproject.example.treadmill/lib/libgnustl_shared.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1652): could not load library "libcrystax.so" needed by "libgnustl_shared.so"; caused by load_library(linker.cpp:759): library "libcrystax.so" not found
    

    It seems to me that this libcrystax.so is not packaged properly into .apk. How do I convince andrioddeployqt (or whoever is responsible for that) to package it so that it can be loaded on the target?

    Has anyone succeeded with deployment of Qt app on android and using CrystaX NDK?
    I'd appreciate any tip.

    Best regards
    Andrzej

    PS. In this particular case I could probably implement my own to_string() functions but for the moment I'd like to try to use CrystaX (since two - out of three - goals of this NDK are Better standard compatibility and Easy porting of existing code to Android)

    1 Reply Last reply
    0
    • FerniF Offline
      FerniF Offline
      Ferni
      wrote on last edited by Ferni
      #2

      I've used CrystaX NDK but then I've changed for Google's NDK. I remember that I had to include a library (probably libcrystax.so) and to deploy your .so with your application you have to add in .pro

      ANDROID_EXTRA_LIBS += path/to/crystax/libcrystax.so
      

      Don't forget to include the ".so"

      A 1 Reply Last reply
      0
      • FerniF Ferni

        I've used CrystaX NDK but then I've changed for Google's NDK. I remember that I had to include a library (probably libcrystax.so) and to deploy your .so with your application you have to add in .pro

        ANDROID_EXTRA_LIBS += path/to/crystax/libcrystax.so
        

        Don't forget to include the ".so"

        A Offline
        A Offline
        AndrzejO
        wrote on last edited by
        #3

        Thank you @Ferni for your reply.

        That pushes me a bit further (but not much). After changing this android: line in .pro into:

         android {
          QMAKE_LIBDIR += /opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a
          ANDROID_EXTRA_LIBS += /opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a/libcrystax.so
        }
        

        I see this libcrystax.so copied into PROJECT_BUILD_DIR/android-build/libs/armeabi-v7a/libcrystax.so so hopefully it is now packaged into the .apk however any attempt to run it on device end up the same way:

        W/ADB_SERVICES( 4817): create_local_service_socket() name=shell:while true; do sleep 1; cat /proc/6159/cmdline > /dev/null; done
        W/ADB_SERVICES( 4817): LS(84): bound to 'shell:while true; do sleep 1; cat /proc/6159/cmdline > /dev/null; done' via 56
        D/dalvikvm( 6159): Trying to load lib /data/data/org.qtproject.example.treadmill/lib/libgnustl_shared.so 0x41b08190
        E/linker  ( 6159): load_library(linker.cpp:759): library "libcrystax.so" not found
        E/linker  ( 6159): soinfo_link_image(linker.cpp:1652): could not load library "libcrystax.so" needed by "libgnustl_shared.so"; caused by load_library(linker.cpp:759): library "libcrystax.so" not found
        E/dalvikvm( 6159): dlopen("/data/data/org.qtproject.example.treadmill/lib/libgnustl_shared.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1652): could not load library "libcrystax.so" needed by "libgnustl_shared.so"; caused by load_library(linker.cpp:759): library "libcrystax.so" not found
        

        Do you happen to remember what else you were doing to make apps with CrystaX runnable?
        And out of my curiosity - what is the reason that you have switched back to the Google NDK?

        Best regards
        Andrzej

        FerniF 1 Reply Last reply
        0
        • A AndrzejO

          Thank you @Ferni for your reply.

          That pushes me a bit further (but not much). After changing this android: line in .pro into:

           android {
            QMAKE_LIBDIR += /opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a
            ANDROID_EXTRA_LIBS += /opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a/libcrystax.so
          }
          

          I see this libcrystax.so copied into PROJECT_BUILD_DIR/android-build/libs/armeabi-v7a/libcrystax.so so hopefully it is now packaged into the .apk however any attempt to run it on device end up the same way:

          W/ADB_SERVICES( 4817): create_local_service_socket() name=shell:while true; do sleep 1; cat /proc/6159/cmdline > /dev/null; done
          W/ADB_SERVICES( 4817): LS(84): bound to 'shell:while true; do sleep 1; cat /proc/6159/cmdline > /dev/null; done' via 56
          D/dalvikvm( 6159): Trying to load lib /data/data/org.qtproject.example.treadmill/lib/libgnustl_shared.so 0x41b08190
          E/linker  ( 6159): load_library(linker.cpp:759): library "libcrystax.so" not found
          E/linker  ( 6159): soinfo_link_image(linker.cpp:1652): could not load library "libcrystax.so" needed by "libgnustl_shared.so"; caused by load_library(linker.cpp:759): library "libcrystax.so" not found
          E/dalvikvm( 6159): dlopen("/data/data/org.qtproject.example.treadmill/lib/libgnustl_shared.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1652): could not load library "libcrystax.so" needed by "libgnustl_shared.so"; caused by load_library(linker.cpp:759): library "libcrystax.so" not found
          

          Do you happen to remember what else you were doing to make apps with CrystaX runnable?
          And out of my curiosity - what is the reason that you have switched back to the Google NDK?

          Best regards
          Andrzej

          FerniF Offline
          FerniF Offline
          Ferni
          wrote on last edited by
          #4

          @AndrzejO said in Has anyone succeeded with CrystaX NDK instead of the Google one?:

          Thank you @Ferni for your reply.

          That pushes me a bit further (but not much). After changing this android: line in .pro into:

           android {
            QMAKE_LIBDIR += /opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a
            ANDROID_EXTRA_LIBS += /opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a/libcrystax.so
          }
          

          I see this libcrystax.so copied into PROJECT_BUILD_DIR/android-build/libs/armeabi-v7a/libcrystax.so so hopefully it is now packaged into the .apk however any attempt to run it on device end up the same way:

          W/ADB_SERVICES( 4817): create_local_service_socket() name=shell:while true; do sleep 1; cat /proc/6159/cmdline > /dev/null; done
          W/ADB_SERVICES( 4817): LS(84): bound to 'shell:while true; do sleep 1; cat /proc/6159/cmdline > /dev/null; done' via 56
          D/dalvikvm( 6159): Trying to load lib /data/data/org.qtproject.example.treadmill/lib/libgnustl_shared.so 0x41b08190
          E/linker  ( 6159): load_library(linker.cpp:759): library "libcrystax.so" not found
          E/linker  ( 6159): soinfo_link_image(linker.cpp:1652): could not load library "libcrystax.so" needed by "libgnustl_shared.so"; caused by load_library(linker.cpp:759): library "libcrystax.so" not found
          E/dalvikvm( 6159): dlopen("/data/data/org.qtproject.example.treadmill/lib/libgnustl_shared.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1652): could not load library "libcrystax.so" needed by "libgnustl_shared.so"; caused by load_library(linker.cpp:759): library "libcrystax.so" not found
          

          Do you happen to remember what else you were doing to make apps with CrystaX runnable?
          And out of my curiosity - what is the reason that you have switched back to the Google NDK?

          Best regards
          Andrzej

          I would write

          android {
          LIBS += -L/opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a -lcrystax
          ANDROID_EXTRA_LIBS += /opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a/libcrystax.so
          }
          Here you can find what are the differences (http://doc.qt.io/qt-5/qmake-variable-reference.html#libs)

          I've changed to Google's NDK because there is no compatibility between compiled libraries with CrystaX and Google's NDK. I had many dependencies in my project and found most of them already compiled for Android (with official NDK).

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved