Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. third party libraries were not packed in apk file in QT android
Qt 6.12 LTS is out! See what's new in the release blog

third party libraries were not packed in apk file in QT android

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

    Hi ,
    I am using QT6 to develop a android app which needs some third party libraries, compiling the project is OK, but I found that the third party libraries were not packed in apk file. I opened the project menu in which I found that the addtioal libraries was gray and I could not add a third party library.
    16868790907878.png

    and I configured the cmake file as below.
    find_library(log-lib log)
    find_library(EGL EGL)
    find_library(GLESv2 GLESv2)
    find_library(android android)

    add_library(avcodec SHARED IMPORTED)
    set_target_properties(avcodec PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libavcodec.so)

    add_library(avfilter SHARED IMPORTED)
    set_target_properties(avfilter PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libavfilter.so)

    add_library(avformat SHARED IMPORTED)
    set_target_properties(avformat PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libavformat.so)

    add_library(avutil SHARED IMPORTED)
    set_target_properties(avutil PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libavutil.so)

    add_library(swresample SHARED IMPORTED)
    set_target_properties(swresample PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libswresample.so)

    add_library(swscale SHARED IMPORTED)
    set_target_properties(swscale PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libswscale.so)

    add_library(SDL2 SHARED IMPORTED)
    set_target_properties(SDL2 PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libSDL2.so)

    #add_library(EGL SHARED IMPORTED)
    #set_target_properties(EGL PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libEGL.so)

    #add_library(GLESv2 SHARED IMPORTED)
    #set_target_properties(GLESv2 PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libGLESv2.so)

    #add_library(android SHARED IMPORTED)
    #set_target_properties(android PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/jniLibs/armeabi-v7a/libandroid.so)

    target_link_libraries(andriodTest2
    PRIVATE Qt${QT_VERSION_MAJOR}::Widgets
    # log
    ${log-lib}

        EGL
        GLESv2
        android
    
        # FFmpeg libs
        avcodec
        avfilter
        avformat
        avutil
        swresample
        swscale
        SDL2
    

    )

    can someone help figure out how to fix this?

    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
    • Unsolved