【问题标题】:Why can't my haxe / openfl app install and launch on the android emulator为什么我的 haxe / openfl 应用程序无法在 android 模拟器上安装和启动
【发布时间】:2016-11-23 15:36:53
【问题描述】:

我安装了以下 haxelibs

openfl 4.4.1 石灰 3.4.1

我有一个非常基本的 hello world 应用程序,我通过运行以下命令在 ios 上成功测试了它

openfl test ios -simulator -Dsource-header=haxe

如果我运行以下命令 openfl test android -emulator 一切似乎都正常,并且模拟器确实启动了,但是 openfl 应用程序似乎没有安装和启动,并且控制台卡在等待应用程序在模拟器中启动。

我尝试运行openfl setup android,因此我的 Android sdk 和 ndk 安装在根 /opt 目录中。我还应该提到我安装了 Android Studio。 Android Studio 似乎使用相同的 SDK 和 NDK 目录。

这是我从 openfl 命令获得的控制台输出。

BUILD SUCCESSFUL

Total time: 17.104 secs


This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.or
g/2.10/userguide/gradle_daemon.html
Usage: adb devices [-l]
Starting AVD: Nexus_4_API_24
Usage: adb devices [-l]
.Usage: adb devices [-l]

【问题讨论】:

  • 我从未在 HAXE 上使用过 OpenFL,我可能会问一个愚蠢的问题,但是您是否已经配置了模拟器?看起来启动模拟器的 adb 命令并不完全正确
  • 我配置了一些模拟器。虽然,openfl 似乎启动了一个我没有配置的模拟器。
  • 没错,好像有一个无效的论点或类似的东西

标签: android haxe openfl


【解决方案1】:

在查看 openfl project.xml 文档时,我发现如果您使用 <certificate/> 并且尚未定义 path= 参数,那么为 android 构建将失败。因此,在我拥有生成有效证书的 google play 帐户之前,我将执行以下操作,以便我可以为 ios 和 android 进行开发。

<certificate team-id="" if="ios"/>

如您所见,我添加了if=,以便仅在为 iOS 构建时使用证书设置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-08-23
    • 2021-04-04
    • 1970-01-01
    • 2015-12-22
    • 2012-04-26
    • 1970-01-01
    • 1970-01-01
    • 2017-10-31
    相关资源
    最近更新 更多