由于未找到qmldir,Android的扩展插件编译失败

时间:2014-06-30 19:49:44

标签: android qt qml qtquick2 qt5.3

我有Qt Creator向导创建的QML扩展插件。当我尝试为Android编译它时,编译失败并显示消息:

  

mingw32-make [1]:输入目录' F:/ work / app-project / build-app-Android_for_armeabi_GCC_4_8_Qt_5_3_1-Debug / extention'
  mingw32-make [1]:***没有规则来制作目标' F:\ work \ app-project \ build-app-Android_for_armeabi_GCC_4_8_Qt_5_3_1-Debug \ extention \ qmldir',需要' libextention的.so&#39 ;.停止。

扩展.pro文件有什么问题?主机操作系统 - Windows 7,Qt - 5.3.1

TEMPLATE = lib
TARGET = extention
QT += qml quick declarative
CONFIG += qt plugin

TARGET = $$qtLibraryTarget($$TARGET)
uri = com.example.extention

# Input
SOURCES += \
    Plugin.cpp \
    extention.cpp

HEADERS += \
    Plugin.h \
    extention.h


OTHER_FILES = 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
unix {
    installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
    qmldir.path = $$installPath
    target.path = $$installPath
    INSTALLS += target qmldir
}

1 个答案:

答案 0 :(得分:0)

使用QRC而不是将.qml文件复制到您的构建目录。 Qt将为您处理所有与系统相关的问题。