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. Using Qt based shared library with the Android NDK
Forum Updated to NodeBB v4.3 + New Features

Using Qt based shared library with the Android NDK

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 3 Posters 766 Views 1 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
    Antonio Ortiz
    wrote on 14 Dec 2020, 04:16 last edited by
    #1

    Hi everyone!
    I'm trying to use a custom shared library that used Qt in an Android NDK project.
    I already manage to include the library inside the Android Studio, but when I compile the App the compiler cannot find the Qt's libraries in my system.
    Is there any way I can configure my project to use the Qt directory and include the Qt library
    Thanks

    J 1 Reply Last reply 14 Dec 2020, 08:48
    0
    • A Antonio Ortiz
      14 Dec 2020, 04:16

      Hi everyone!
      I'm trying to use a custom shared library that used Qt in an Android NDK project.
      I already manage to include the library inside the Android Studio, but when I compile the App the compiler cannot find the Qt's libraries in my system.
      Is there any way I can configure my project to use the Qt directory and include the Qt library
      Thanks

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 14 Dec 2020, 08:48 last edited by
      #2

      @Antonio-Ortiz You can start here https://doc.qt.io/qt-5/android.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Antonio Ortiz
        wrote on 14 Dec 2020, 13:15 last edited by
        #3

        Thanks, @jsulm.
        But that documentation is not helpful. I don't need to compile an application for Android, I need to use a custom Qt library inside an Android project.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          KH-219Design
          wrote on 14 Dec 2020, 18:22 last edited by
          #4

          I'm not ultra confident in my answer, so take it with a grain of salt...

          Hopefully you (@Antonio-Ortiz ) are able to compile the "custom shared library that used Qt" manually.

          If you are, then when you compile this custom shared library, I think you will want to link it statically to Qt.

          It sounds like your Android project does find the custom library, but it then fails to find the transitive dependencies of it. Hence my suggestion (which I have not attempted). I figure that if you make the custom library "bake in" (statically) all its dependencies, then the problem disappears because there are no transitive dependencies needed.

          But this is just me thinking generically about generic cases of compiling arbitrary c/c++ code. I realize there are numerous restrictions and other trade-offs that enter the picture when we deal with "opinionated" frameworks and IDE(s). That's why I'm not 100% sure that what I propose is feasible.

          Another thought: I think you might need to post in a forum or mailing list for Android studio experts. I would never discourage you from coming here first (this community is phenomenal!). But I think the problem of configuring your Android project (which is not itself Qt based, right?).... configuring that Android project to find transitive third-party dependencies of a custom library... this feels like a question for Android experts more so than Qt experts.

          www.219design.com
          Software | Electrical | Mechanical | Product Design

          A 1 Reply Last reply 14 Dec 2020, 19:58
          0
          • K KH-219Design
            14 Dec 2020, 18:22

            I'm not ultra confident in my answer, so take it with a grain of salt...

            Hopefully you (@Antonio-Ortiz ) are able to compile the "custom shared library that used Qt" manually.

            If you are, then when you compile this custom shared library, I think you will want to link it statically to Qt.

            It sounds like your Android project does find the custom library, but it then fails to find the transitive dependencies of it. Hence my suggestion (which I have not attempted). I figure that if you make the custom library "bake in" (statically) all its dependencies, then the problem disappears because there are no transitive dependencies needed.

            But this is just me thinking generically about generic cases of compiling arbitrary c/c++ code. I realize there are numerous restrictions and other trade-offs that enter the picture when we deal with "opinionated" frameworks and IDE(s). That's why I'm not 100% sure that what I propose is feasible.

            Another thought: I think you might need to post in a forum or mailing list for Android studio experts. I would never discourage you from coming here first (this community is phenomenal!). But I think the problem of configuring your Android project (which is not itself Qt based, right?).... configuring that Android project to find transitive third-party dependencies of a custom library... this feels like a question for Android experts more so than Qt experts.

            A Offline
            A Offline
            Antonio Ortiz
            wrote on 14 Dec 2020, 19:58 last edited by
            #5

            @KH-219Design said in Using Qt based shared library with the Android NDK:

            ion for And

            Thanks for your answer.
            Yes, compile the shared library and link statically Qt could be the solution. I'll give it a try.
            The only thing that worries me is any licensing issues. I'll mark this thread as solved.

            1 Reply Last reply
            0

            1/5

            14 Dec 2020, 04:16

            • Login

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