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. Deploy Qt android subdirs project with cmake qt 6.5
Qt 6.11 is out! See what's new in the release blog

Deploy Qt android subdirs project with cmake qt 6.5

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 250 Views
  • 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.
  • SheepS Offline
    SheepS Offline
    Sheep
    wrote on last edited by
    #1

    Greetings..am trying to deploy an android subdirs project to but the app keeps crashing because i has failed to find the project library...
    The project library is bundled in the apk but the android "library loader" keeps reporting this

    
    E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "..\untitled1\libuntitled1.so" not found: needed by /data/app/~~vVxfhT5lXJxFAv4RXVtueA==/org.qtproject.example.appuntitled-5I3ElTuRc5k4WmPok0ZQCQ==/lib/arm64/libappuntitled_arm64-v8a.so in namespace
    

    Every thing builds successfully, but the app crahes when its ran/deployed on the device (real android device)
    Any help!

    Here is the cmake !

    Project cmake file

    cmake_minimum_required(VERSION 3.16)
    set(PROJECT_NAME TestSubDir)
    
    add_subdirectory("./untitled")
    add_subdirectory("./untitled1")
    
    

    Untitled cmake file

    cmake_minimum_required(VERSION 3.16)
    
    project(untitled VERSION 0.1 LANGUAGES CXX)
    
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    
    set(GLESv2_INCLUDE_DIR "${CMAKE_ANDROID_NDK}/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/GLES2")
    
    find_package(Qt6 6.2 COMPONENTS Quick REQUIRED)
    
    qt_add_executable(appuntitled
        main.cpp
    )
    
    qt_add_qml_module(appuntitled
        URI untitled
        VERSION 1.0
        QML_FILES main.qml 
    )
    
    # For Desktop AFAIK
    #set_target_properties(appuntitled PROPERTIES
    #    MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
    #    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    #    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    #    MACOSX_BUNDLE TRUE
    #    WIN32_EXECUTABLE TRUE
    #)
    target_link_libraries(appuntitled PRIVATE untitled1)
    
    #failed
    target_link_libraries(appuntitled
        PRIVATE Qt6::Quick)
    
    # failed
    set_property(TARGET ${GW_LIBRARY_NAME} PROPERTY QT_ANDROID_EXTRA_LIBS
    ${CMAKE_CURRENT_BINARY_DIR}/../untitled1/libuntitled1_${CMAKE_ANDROID_ARCH_ABI}.so
    
    )
    
    # For Desktop AFAIK
    #install(TARGETS appuntitled
    #    BUNDLE DESTINATION .
    #    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
    
    

    Untitled1 cmake file

    cmake_minimum_required(VERSION 3.14)
    
    project(untitled1 LANGUAGES CXX)
    
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
    find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
    
    add_library(untitled1 SHARED
      untitled1_global.h
      untitled1.cpp
      untitled1.h
    )
    target_include_directories(untitled1 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
    target_link_libraries(untitled1 PRIVATE Qt${QT_VERSION_MAJOR}::Core)
    
    target_compile_definitions(untitled1 PRIVATE UNTITLED1_LIBRARY)
    
    
    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