为什么我无法在 ubuntu-touch 模拟器上启动演示应用程序

为什么我无法在 ubuntu-touch 模拟器上启动演示应用程序

我刚刚创建了一个新的 ubuntu 触摸模拟器(ubuntu 14.10 sdk i386 devel)。

Check device image version..
X86 Emulator 
aosp_x86 
generic_x86 
243 
i386 

我有一个默认的 QML 代码:

import QtQuick 2.0
import Ubuntu.Components 1.1

/*!
    \brief MainView with a Label and Button elements.
*/

MainView {
    // objectName for functional testing purposes (autopilot-qt5)
    objectName: "mainView"

    // Note! applicationName needs to match the "name" field of the click manifest
    applicationName: "com.ubuntu.developer.username.newapp"

    /*
     This property enables the application to change orientation
     when the device is rotated. The default is false.
    */
    //automaticOrientation: true

    // Removes the old toolbar and enables new features of the new header.
    useDeprecatedToolbar: false

    width: units.gu(100)
    height: units.gu(75)

    Page {
        title: i18n.tr("Simple")

        Column {
            spacing: units.gu(1)
            anchors {
                margins: units.gu(2)
                fill: parent
            }

            Label {
                id: label
                objectName: "label"

                text: i18n.tr("Hello..")
            }

            Button {
                objectName: "button"
                width: parent.width

                text: i18n.tr("Tap me!")

                onClicked: {
                    label.text = i18n.tr("..world!")
                }
            }
        }
    }
}

当我在模拟器上运行我的应用程序时,我收到两个警告:

:-1: warning: desktop_Exec (app): found unexpected Exec with architecture 'all': ./qtc_device_debughelper.py

:-1: warning: security_policy_groups_safe_app (debug): (REJECT) reserved policy group 'debug': not for production use
The debug policy group is automatically injected and should only be used for development.
To create a package for the store use the publish tab!

显然,我的应用程序无法在 ubuntu-touch 上启动......

这是我的应用程序输出:

Warning: Permanently added '[127.0.0.1]:10000' (RSA) to the list of known hosts.
Sdk-Launcher> Executing:     /tmp/com.ubuntu.developer.username.newapp_0.1_all.click
Sdk-Launcher> Force Install: False
Sdk-Launcher> Skip Uninstall:False
Sdk-Launcher> Launcher PID: 12359
Sdk-Launcher> Installing application .....
Sdk-Launcher> Installing the application failed

这是我的编译输出:

16:34:07: Running steps for project newApp...
sending incremental file list
deleting qtc_device_debughelper.py
./
app.apparmor
app.desktop

sent 480 bytes  received 86 bytes  1.13K bytes/sec
total size is 40.86K  speedup is 72.19
16:34:07: The process "/usr/bin/rsync" exited normally.
WARNING:root:Ignoring missing framework "ubuntu-sdk-14.10"
Successfully built package in './com.ubuntu.developer.username.newapp_0.1_all.click'.
16:34:07: The process "/usr/bin/click" exited normally.
16:34:07: The click package has been created in /home/morgan/qt/build-newApp-u1504_GCC_i386_ubuntu_sdk_14_10_utopic-default
= content_hub =
{
  "error": {},
  "info": {},
  "warn": {}
}
= desktop =
{
  "error": {},
  "info": {
    "desktop_Comment_boilerplate (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_Exec_webapp_args (app)": {
      "manual_review": false,
      "text": "SKIPPED (not webapp-container or webbrowser-app)"
    },
    "desktop_Exec_webapp_container (app)": {
      "manual_review": false,
      "text": "SKIPPED (not webapp-container)"
    },
    "desktop_Exec_webbrowser (app)": {
      "manual_review": false,
      "text": "SKIPPED (not webbrowser-app)"
    },
    "desktop_Icon (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_Terminal (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_Type (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_Version (app)": {
      "manual_review": false,
      "text": "OK (not specified)"
    },
    "desktop_X-Ubuntu-Gettext-Domain (app)": {
      "manual_review": false,
      "text": "OK (not specified)"
    },
    "desktop_X-Ubuntu-StageHint (app)": {
      "manual_review": false,
      "text": "OK (not specified)"
    },
    "desktop_X-Ubuntu-Touch (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_blacklisted_keys (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_duplicate_keys (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_files_usable": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_groups (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_required_fields_not_empty (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_required_keys (app)": {
      "manual_review": false,
      "text": "OK"
    },
    "desktop_validates (app)": {
      "manual_review": false,
      "text": "OK"
    }
  },
  "warn": {
    "desktop_Exec (app)": {
      "manual_review": false,
      "text": "found unexpected Exec with architecture 'all': ./qtc_device_debughelper.py"
    }
  }
}
= functional =
{
  "error": {},
  "info": {
    "functional_qml_applicationName_matches_manifest": {
      "manual_review": false,
      "text": "OK"
    },
    "functional_qml_application_uses_QtWebKit": {
      "manual_review": false,
      "text": "OK"
    },
    "functional_qml_application_uses_UbuntuWebView_0.2": {
      "manual_review": false,
      "text": "OK"
    },
    "functional_qml_application_uses_friends": {
      "manual_review": false,
      "text": "OK"
    }
  },
  "warn": {}
}
= lint =
{
  "error": {},
  "info": {
    "lint_DEBIAN_extra_files": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_DEBIAN_has_control": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_DEBIAN_has_manifest": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_DEBIAN_has_md5sums": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_DEBIAN_has_preinst": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_click_files": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_click_local_extensions": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_architecture_match": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_architecture_specified_needed": {
      "manual_review": false,
      "text": "SKIPPED: architecture is 'all'"
    },
    "lint_control_architecture_valid": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_architecture_valid_contents": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_click_version_up_to_date": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_description_match": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_has_Architecture": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_has_Click-Version": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_has_Description": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_has_Installed-Size": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_has_Maintainer": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_has_Package": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_has_Version": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_installed_size": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_maintainer_match": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_package_match": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_structure": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_control_version_match": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_description": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_description_present": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_exclusive_hooks_app": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_external_symlinks": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_framework": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_hardcoded_paths": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_hooks_app_apparmor": {
      "manual_review": false,
      "text": "OK (run check-security for more checks)"
    },
    "lint_hooks_app_apparmor_known": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_hooks_app_desktop_known": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_hooks_app_valid": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_hooks_multiple_apps": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_hooks_redflag_app": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_icon_present": {
      "manual_review": false,
      "text": "Skipped, optional icon not present"
    },
    "lint_maintainer_domain": {
      "manual_review": false,
      "text": "OK (package domain=('com.ubuntu.developer.', 'net.launchpad.'))"
    },
    "lint_maintainer_format": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_maintainer_present": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_manifest_architecture_valid": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_md5sums": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_package_filename_arch_match": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_package_filename_arch_valid": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_package_filename_format": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_package_filename_matches_namespace": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_package_filename_pkgname_match": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_package_filename_version_match": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_pkgname_valid": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_preinst": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_sdk_security_extension_app": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_title": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_title_present": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_vcs_files": {
      "manual_review": false,
      "text": "OK"
    },
    "lint_version_valid": {
      "manual_review": false,
      "text": "OK"
    }
  },
  "warn": {}
}
= online_accounts =
{
  "error": {},
  "info": {},
  "warn": {}
}
= push_helper =
{
  "error": {},
  "info": {},
  "warn": {}
}
= scope =
{
  "error": {},
  "info": {},
  "warn": {}
}
= security =
{
  "error": {
    "security_policy_groups_safe_app (debug)": {
      "manual_review": false,
      "text": "(REJECT) reserved policy group 'debug': not for production use"
    }
  },
  "info": {
    "security_ignored_fields (app.apparmor)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_policy_groups_duplicates_app (app.apparmor)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_policy_groups_exists_app (app.apparmor)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_policy_groups_safe_app (networking)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_policy_groups_valid_app (debug)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_policy_groups_valid_app (networking)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_policy_vendor (app.apparmor)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_policy_version_exists (app.apparmor)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_policy_version_is_highest (1.2, app.apparmor)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_policy_version_matches_framework (app.apparmor)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_redflag_fields (app.apparmor)": {
      "manual_review": false,
      "text": "OK"
    },
    "security_template_valid (app.apparmor)": {
      "manual_review": false,
      "text": "OK (none specified)"
    },
    "security_template_with_policy_version (app.apparmor)": {
      "manual_review": false,
      "text": "OK"
    }
  },
  "warn": {}
}
= url_dispatcher =
{
  "error": {},
  "info": {},
  "warn": {}
}
16:34:08: The process "/usr/bin/click" exited with code 1.
16:34:08: Ignoring return code for this step
16:34:08: Uploading file '/home/morgan/qt/build-newApp-u1504_GCC_i386_ubuntu_sdk_14_10_utopic-default/com.ubuntu.developer.username.newapp_0.1_all.click'...
16:34:08: Uploading file '/usr/share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py'...
16:34:08: All files successfully deployed.
16:34:08: Deploy step finished.
16:34:08: Elapsed time: 00:02.

这是我的 manifest.json

{
    "architecture": "all",
    "description": "description of newApp",
    "framework": "ubuntu-sdk-14.10",
    "hooks": {
        "app": {
            "apparmor": "app.apparmor",
            "desktop": "app.desktop"
        }
    },
    "maintainer": "Morgan DURAND <[email protected]>",
    "name": "com.ubuntu.developer.username.newapp",
    "title": "newApp",
    "version": "0.1"
}

编辑 :

我决定从头创建一个新的模拟器。

第一步,创建一个模拟器:

在此处输入图片描述

Checking installed emulator package.
ii ubuntu-emulator 0.4+15.04.20141104.1-0ubuntu1

Search configured emulator instances.
ubuntui386 ubuntu=20140917,device=20140917,version=243,arch=i386

Detecting device..
Creating new emulator instance.
Creating "ubui386" from devel revision 243
Downloading...

Setting up...

Setting up a default password for phablet to: '0000'

现在,我通过点击“自动创建套件”来创建新套件 在此处输入图片描述

这是自动创建的结果: 在此处输入图片描述

这是我的 manifest.json:

{
    "architecture": "all",
    "description": "description of newApp",
    "framework": "ubuntu-sdk-14.10",
    "hooks": {
        "app": {
            "apparmor": "app.apparmor",
            "desktop": "app.desktop"
        }
    },
    "maintainer": "Morgan DURAND <[email protected]>",
    "name": "com.ubuntu.developer.username.newapp",
    "title": "newApp",
    "version": "0.1"
}

我仍然有同样的问题

注意:我创建了一个 i386 图像,因为我无法创建 armhf 图像:

Checking installed emulator package.
ii ubuntu-emulator 0.4+15.04.20141104.1-0ubuntu1

Search configured emulator instances.
cat: /home/morgan/.local/share/ubuntu-emulator/ubuntuarmhf/.device: No such file or directory


Detecting device..
Creating new emulator instance.
Creating "ubuntuarmhf" from devel revision 243
Downloading...

Setting up...

Setting up a default password for phablet to: '0000'

chroot: failed to run command ‘/bin/sh’: Exec format error



Search configured emulator instances.
cat: /home/morgan/.local/share/ubuntu-emulator/ubuntuarmhf/.device: No such file or directory

答案1

当模拟器的架构与用于构建包的点击目标的架构不匹配时,就会发生此错误。(我花了很长时间才弄清楚。)

根据您在帖子中包含的编译输出,您使用的是 i386 点击目标。我猜您已经构建并运行了 armhf 模拟器,因此出现错误。

您需要执行以下操作之一:

  • 创建一个 i386 模拟器(这是推荐的选择)
  • 创建一个 armhf 点击目标(您可以通过在 Qt Creator 中转到工具->选项...并单击侧面列表中的“Ubuntu”来执行此操作)

我推荐第一个选择,因为 i386 仿真器的运行速度比 armhf 仿真器快几个数量级。(armhf 仿真器必须模拟 ARM CPU。)

相关内容