Home > Enterprise >  Erro trying to build qml lib to Android
Erro trying to build qml lib to Android

Time:05-21

I'm using a qml lib with a qt c projetc, and work well in linux and windows, but when I try to build to Android I receive this error:

make: *** No rule to make target 'install'.  Stop.
09:40:07: The process "/home/ysaakue/Android/Sdk/ndk/21.3.6528147/prebuilt/linux-x86_64/bin/make" exited with code 2.
Error while building/deploying project IracemaCharts (kit: Android Qt 5.15.2 Clang Multi-Abi)
When executing step "Copy application data"
09:40:07: Elapsed time: 00:01.

that is my build config: enter image description here

and that is my android device config: enter image description here

EDIT: this is my .pro file:

TEMPLATE = lib
TARGET = IracemaCharts
QT  = qml quick
CONFIG  = plugin c  11 qmltypes

QML_IMPORT_NAME = IracemaCharts
QML_IMPORT_MAJOR_VERSION = 0
QML_IMPORT_MINOR_VERSION = 1

TARGET = $$qtLibraryTarget($$TARGET)
uri = IracemaCharts

# Input
SOURCES  = \
        iracemalineseries.cpp \
        iracemacharts_plugin.cpp \
        iracemacharts.cpp \
        iracemalineseriesview.cpp

HEADERS  = \
        iracemalineseries.h \
        iracemacharts_plugin.h \
        iracemacharts.h \
        iracemalineseriesview.h

DISTFILES = qmldir

!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
    copy_qmldir.target = $$OUT_PWD/qmldir
    copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
    copy_qmldir.commands = $(COPY_FILE) "$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)" "$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)"
    QMAKE_EXTRA_TARGETS  = copy_qmldir
    PRE_TARGETDEPS  = $$copy_qmldir.target
}

qmldir.files = qmldir
qmldir.files  = plugins.qmltypes
unix {
    installPath = $$[QT_INSTALL_QML]/$$replace(uri, \., /)
    qmldir.path = $$installPath
    target.path = $$installPath
    copy_qmltypes.path = $$installPath
    copy_qmltypes.files = $$OUT_PWD/plugins.qmltypes
    INSTALLS  = target qmldir copy_qmltypes
}

windows {
    installPath = $$[QT_INSTALL_QML]/$$replace(uri, \., /)
    installPath = $$replace(installPath, /, \\)
    qmldir.path = $$installPath
    target.path = $$installPath
    copy_qmltypes.path = $$installPath
    copy_qmltypes.files = $$OUT_PWD/plugins.qmltypes
    INSTALLS  = target qmldir copy_qmltypes
}

I'm using Qt version 5.15.2.

CodePudding user response:

Try adding this lines to your project file(.pro):

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS  = target

Now it should work.

CodePudding user response:

Apparently the problem was because this project is a lib, and in the default build steps has some to copy the files to target device, and in my case it isn't required, so I disabled(using the QtCreator interface as bellow) the last two stets and the problem was solved. (for now at least).

enter image description here

  • Related