Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt6.1 android and subdirectory shared libs



  • Good day!

    Let me describe the situation I've found with android compilation and deploy.

    As usual I have use sub directories for creating shared libs.

    1. When you try to create CMakeLists.txt in project root dir and gui as sub dir and add gui dir by "add_subdirectory"
      in core project file, the build will fail with "No target architecture defined in json file."

    2. If you try to use gui application dir as a root project dir with lib subdir compilation of shared lib will fail.

    QtCreator build normal deployment-settings.json for gui, but whron settings.json for subdir lib
    67c08441-5a11-42d2-a975-34bbfb167449-изображение.png
    aa48bb57-d1c4-4bf4-83de-c0a7f258fec6-изображение.png

    As you can see there is no correct setting info is sub project.

    The question is -> Have I possibilities to use complicated modules management with libraries and sub directories.

    Platform: Linux Ubuntu 21.04, QtCreator 4.15, Qt 6.1

    Thank's a lot for your attention and answers.



  • I have a similar problem on Windows. Here is a workaround I use.

    Consider this 'master' (top) CMakeLists.txt:

    add_subdirectory(MyGui)
    add_subdirectory(MyLib)
    

    ... then the build directory will contain:

    build directory (android-MyGui-deployment-settings.json, ...)
    |_ MyLib
    |_ MyGui (android-MyGui-deployment-settings.json, ...)
    |_ ...
    

    There are two android-MyGui-deployment-settings.json files there, one in the root and one in the MyGui folder.
    Simple copy the one from MyGui and overwrite the one in the root - and you are ready to debug or run the app!


Log in to reply