簡體   English   中英

Qt創建者沒有為android構建項目

[英]Qt creator doesn't build the project for android

我在Linux Ubuntu上配置了SDK,JDK,NDK。 但是當我嘗試為android構建我的項目時,會發生這些錯誤(所有編譯輸出):

18:28:22: Running steps for project InstaDL...
18:28:22: Configuration unchanged, skipping qmake step.
18:28:22: Starting: "/usr/bin/make" 
make: Nothing to be done for 'first'.
18:28:22: The process "/usr/bin/make" exited normally.
18:28:22: Removing directory /home/muhammad/Documents/qt_projects/build-InstaDL-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Release/android-build/assets
18:28:22: Removing directory /home/muhammad/Documents/qt_projects/build-InstaDL-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Release/android-build/libs
18:28:22: Starting: "/usr/bin/make" INSTALL_ROOT=/home/muhammad/Documents/qt_projects/build-InstaDL-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Release/android-build install
/home/muhammad/Qt5.9.0/5.9/android_armv7/bin/qmake -install qinstall program libInstaDL.so /home/muhammad/Documents/qt_projects/build-InstaDL-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Release/android-build/libs/armeabi-v7a/libInstaDL.so
18:28:22: The process "/usr/bin/make" exited normally.
18:28:22: Starting: "/home/muhammad/Qt5.9.0/5.9/android_armv7/bin/androiddeployqt" --input /home/muhammad/Documents/qt_projects/build-InstaDL-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Release/android-libInstaDL.so-deployment-settings.json --output /home/muhammad/Documents/qt_projects/build-InstaDL-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Release/android-build --deployment bundled --android-platform android-25 --jdk /home/muhammad/Android/jdk1.8.0_131 --gradle
Generating Android Package
  Input file: /home/muhammad/Documents/qt_projects/build-InstaDL-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Release/android-libInstaDL.so-deployment-settings.json
  Output directory: /home/muhammad/Documents/qt_projects/build-InstaDL-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Release/android-build/
  Application binary: /home/muhammad/Documents/qt_projects/build-InstaDL-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Release/libInstaDL.so
  Android build platform: android-25
  Install to device: No
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
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: /home/muhammad/.gradle/wrapper/dists/gradle-3.4-bin/aeufj4znodijbvwfbsq3044r0/gradle-3.4-bin.zip
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Building the android package failed!
  -- For more information, run this command with --verbose.
18:30:23: The process "/home/muhammad/Qt5.9.0/5.9/android_armv7/bin/androiddeployqt" exited with code 14.
Error while building/deploying project InstaDL (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.9.0 for Android armv7))
When executing step "Build Android APK"
18:30:23: Elapsed time: 02:01.

我該怎么做才能解決這個問題? 提前致謝。

例外的關鍵是:

Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: /home/muhammad/.gradle/wrapper/dists/gradle-3.4-bin/aeufj4znodijbvwfbsq3044r0/gradle-3.4-bin.zip`

在我以前的雇主,很久以前我們遇到了同樣的問題(使用gradle 1.x )。 這是不是在自己的gradle或有人使用方式的限制(gradle這個 不是構建工具,這只是其中一個完整的構建過程中執行的次數十分之一的輔助)。
[Gradle]:Gradle-1.1:“等待120.0秒Gradle Worker N連接后超時。”包含類似的行為。

但是,根據: [Gradle]:同時運行多個gradle進程

實際上,您可以合理安全地在同一個項目上運行兩個Gradle進程, 只要它們不會混淆彼此正在做的事情 (例如刪除創建的文件)。

擺脫這種情況的一種方法 (對我有用):

  • 找到保持文件鎖定的( gradlejava )進程(可能是以前的構建掛起) - 你可以使用[man]:lsof找出鎖定文件的進程 - 並將其殺死
  • 如果上面的步驟不夠,還要清理gradle的緩存

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM