如何解决Qt Build for android-19
我正在使用 Qt 5.15
创建应用程序。
Android 套件存在并设置为 android-29
,一切正常。但是我有一台运行 android 4.4.4
的旧设备,所以我需要使用 android-19
平台。我下载了平台,它可以在 build
的 Build & Run
菜单中选择。
根据我的理解,它应该能够使用 Qt 5.15
进行编译还是我需要降低?
使用:
NDK:r21
这是编译器错误:
> Task :processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
D:\App-Android_for_armeabi_v7a_arm64_v8a_x86_x86_64_Clang_Qt_5_15_0_for_Android-Debug\android-build\AndroidManifest.xml:20:5-81:19: AAPT: error: attribute android:extractNativeLibs not found.
D:\App-Android_for_armeabi_v7a_arm64_v8a_x86_x86_64_Clang_Qt_5_15_0_for_Android-Debug\android-build\AndroidManifest.xml:21:9-79:20: AAPT: error: 'orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density' is incompatible with attribute configChanges (attr) flags [locale=4,mcc=1,mnc=2,touchscreen=8,keyboard=16,keyboardHidden=32,navigation=64,orientation=128,screenLayout=256,uiMode=512,screenSize=1024,smallestScreenSize=2048,layoutDirection=8192,fontScale=1073741824].
解决方法
经过一番修修补补,我终于可以编译了。我将把这个留作答案,以便它可以帮助其他人。
正如上面的错误所说,清单中的某些属性不起作用,因此我删除了 attribute android:extractNativeLibs
和 android:configChanges
。如果你已经有 Qt Creator 创建的 android 文件夹,删除它并重新生成它,然后删除上面的那些。
此后,它抱怨使用新的 Java 功能。所以我下载了 Qt 5.12.10
并使用了这个工具包。
另外不要忘记将 5.12
文件中的所有导入更改为 .qml
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。