Qt Android Build Error

时间:2017-01-04 09:05:56

标签: android qt ant android-gradle windows-10

我正在尝试使用Qt和Qt Quick Controls 2创建我的第一个Android应用程序,但是当我尝试运行该应用程序时,我得到了apache ant:

[aapt] android-build\bin\AndroidManifest.xml:4: error: Error: 
String types not allowed (at 'configChanges' with value' orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation').
 [aapt] 

BUILD FAILED
Android\sdk\tools\ant\build.xml:653: The following error occurred while executing this line:
Android\sdk\tools\ant\build.xml:698: null returned: 1

Total time: 1 second
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.Material.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
Building the android package failed!
10:16:43: The process "Qt\5.7\android_armv7\bin\androiddeployqt.exe" exited with code 14.
Error while building/deploying project appTest (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.7.1))
When executing step "Build Android APK"

我在这里尝试了修复:Why is BUILD FAILED?

但它没有帮助,或者我做错了,但如果我尝试使用gradel构建项目,我会得到这个错误:

Successfully started process 'command 'D:\Coding\Android\sdk\build-tools\25.0.2\aapt.exe''
 Position 40:36-165 : String types not allowed (at 'configChanges' with value 'orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation').

:processDebugResources FAILED
:processDebugResources (Thread[main,5,main]) completed. Took 0.19 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'Android\sdk\build-tools\25.0.2\aapt.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 5.288 secs
Stopped 0 compiler daemon(s).
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.Material.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
Building the android package failed!
10:56:36: The process "Qt\5.7\android_armv7\bin\androiddeployqt.exe" exited with code 14.
Error while building/deploying project appTest (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.7.1))
When executing step "Build Android APK"

Qt 5.7.1

QtCreator 4.2.0

AVD:API等级16 armeabi-v7a

0 个答案:

没有答案