Ubuntu SDK:模板 HTML5 應用程式顯示警告

Ubuntu SDK:模板 HTML5 應用程式顯示警告

我使用 Ubuntu SDK 創建了一個新的 HTML5 應用程序,每當我單擊該Run按鈕時,我都會在控制台上看到以下輸出:

Setting import path to:  /home/dbugger/Bautista/www/../lib/x86_64-linux-gnu 

WARNING: This project is using the experimental QML API extensions for QtWebKit and is therefore tied to a specific QtWebKit release.
WARNING: The experimental API will change from version to version, or even be removed. You have been warned!

unity::action::ActionManager::ActionManager(QObject*):
    Could not determine application identifier. HUD will not work properly.
    Provide your application identifier in $APP_ID environment variable.
Cannot create CordovaView object.
Falling back on the plain Webview backend.
Inspector server started successfully. Try pointing a WebKit browser to http://192.168.178.25:9221

** (ubuntu-html5-app-launcher:16912): WARNING **: Unable to register app: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Invalid application ID
Injecting webapps script[0] : file:///usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/UnityWebApps/unity-webapps-api.js

我收到有關使用實驗性 API 的警告,但接下來的消息非常令人費解。我不太明白他們想說什麼,但看起來我好像錯過了什麼。

有人可以向我解釋它們是什麼嗎?

答案1

我將嘗試提供有關其他消息的更多詳細資訊:

  • “unity::action::ActionManager::ActionManager(QObject*):無法確定應用程式識別碼。HUD 將無法正常工作。在 $APP_ID 環境變數中提供您的應用程式識別碼。”

正如您所看到的,這個是無害的並且與 HUD 有關。 HTML5 應用程式啟動器使用 HUD 作為其某些公開 API 的後端。 HUD 需要設定一些應用程式上下文資料才能正常運作。這些資訊通常是在應用程式啟動時由環境設定的,但在 qtcreator 的上下文中並非如此。如果手動啟動應用程序,可以自行設置,例如“APP_ID= ubuntu-html5-app-launcher --www=www”

  • “無法建立 CordovaView 物件。退回到普通 Webview 後端。”

同樣,這比警告提供的資訊更多,無需擔心。您可能知道 HTML5 應用程式可以使用 Ubuntu Javascript API 和 Cordova API。預設情況下,Cordova API 不可用,您必須啟用它們(一些執行時間程式庫將額外打包在您的 Click 應用程式中)。無論您是否使用 cordova,運行時後端在內部都是不同的。此訊息只是告訴您 cordova API 不可用,您將使用“僅”打包 Ubuntu Javascript API 的預設運行時運行,

  • “**(ubuntu-html5-app-launcher:16912):警告**:無法註冊應用程式:GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs:無效的應用程式ID”

此警告與第一個警告相同,缺少 APP_ID 環境變數(通常由環境設定)會阻止一些次要的內部元素工作,

希望能幫助你,

相關內容