为安卓构建时出现Qt错误
Qt errors while building for android
当我尝试在适用于Android的Qt Creator中构建我的项目时,会发生以下错误:
Warning: QML import could not be resolved in any of the import paths: Qt.Class
Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Material.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
FAILURE: Build failed with an exception.
这是我.pro
文件内容:
QT += qml quick
CONFIG += c++11
SOURCES += main.cpp
downloader.cpp
filemanager.cpp
HEADERS +=
downloader.h
filemanager.h
RESOURCES += qml.qrc
QT += network
QT += xml
QT += gui
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = /home/muhammad/Qt5.9.0/5.9/android_armv7/qml/
# Additional import path used to resolve QML modules just for Qt Quick Designer
#QML_DESIGNER_IMPORT_PATH =
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
DISTFILES +=
android/AndroidManifest.xml
android/gradle/wrapper/gradle-wrapper.jar
android/gradlew
android/res/values/libs.xml
android/build.gradle
android/gradle/wrapper/gradle-wrapper.properties
android/gradlew.bat
android/AndroidManifest.xml
android/gradle/wrapper/gradle-wrapper.jar
android/gradlew
android/res/values/libs.xml
android/build.gradle
android/gradle/wrapper/gradle-wrapper.properties
android/gradlew.bat
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
我该如何解决?
如错误所示,您需要将 Gradle 至少更新到 2.14.1 https://gradle.org/releases
相关文章:
- Qt 错误:QSqlQuery::value:尝试从表中检索统计信息时未定位在有效记录上 (QComboBox)
- Qt 错误 iso c++ 禁止指针和整数之间的比较 -permissive
- Qt 错误消息"qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed"
- Qt 错误:未定义对"str2ba"的引用
- 为安卓构建时出现Qt错误
- 模型对话框移动到主窗口后面的Qt错误
- QT 5 [ 错误: QtGui/QApplication: 没有这样的文件或目录]
- QT错误:运行代码后,在QT中获得Protobuf错误
- Linux/QT-错误创建SSL上下文(错误:140A90C4 ..)
- Qt 错误:错误:调用"QHBoxLayout::addItem(QPushButton*&)"没有匹配函数
- QT错误:搜索不存在的函数
- QT错误:LNK1120:1未解决的外部Main.OBJ:-1:错误:LNK2019运行QMAKE
- 在QIODevice::Append模式下打开的QFile意外工作.这是一个Qt错误吗
- QT - C++错误:在此上下文中'QWidget::QWidget(const QWidget&)'是私有的
- Qt错误:在Mac OS X Yosemite上找不到体系结构x86_64的符号
- 在Mac中构建Qt 5.4错误
- 连接DLL后出现QT 5.4错误
- 带有 QT 错误的 OpenGL:ASSERT:"QOpenGLFunctions::isInitialized(d_ptr)" 。无法创建 OpenGL 上下文
- 在Qt Creator中编译时出现Qt错误
- 参数计数不匹配 SQLite 和 Qt 错误