【问题标题】:ANE Extension Context nullANE 扩展上下文 null
【发布时间】:2014-08-01 07:07:08
【问题描述】:

我在我的项目中使用 FreshPlanet KeyboardSize ANE。我已成功添加到我的项目中,但是当我运行时

MeasureKeyboard.getInstance().setKeyboardAdjustNothing();

我收到以下错误。

ArgumentError: Error #3500: The extension context does not have a method with the name setKeyboardAdjustNothing. at flash.external::ExtensionContext/_call() at flash.external::ExtensionContext/call() at com.freshplanet.ane.KeyboardSize::MeasureKeyboard/setKeyboardAdjustNothing()e

我该如何解决这个问题?

谢谢。

【问题讨论】:

  • 您是否在设备上收到此错误?或者当你在电脑上测试电影的时候?
  • 我进入了设备和 adt.exe。我正在使用 Intellij IDEA。
  • 我认为这可能是 ANE 中的错误。我查看了 com.freshplanet.ane.KeyboardSize 源,我认为它没有创建正确的上下文。它为“com.freshplanet.KeyboardSize”而不是“com.freshplanet.ane.KeyboardSize”创建扩展上下文。您可以通过尝试调用 MeasureKeyboard.getInstance() 上的其他函数来验证这一点
  • 我已尝试运行所有功能。当我跟踪 MeasureKeyboard.getInstance() 上下文不为空。当我调用该上下文的任何函数时存在问题。这可能与 Intellij IDEA 有关。

标签: actionscript-3 mobile air air-native-extension ane


【解决方案1】:

确保来自 src 和 bin-debug 文件夹的 Application-app.xml 包含与 ANE 源代码中 ExtensionContext.createExtensionContext(NAME_OF_THE_EXTENSION_ID,null) 中调用的内容完全匹配的 NAME_OF_THE_EXTENSION_ID 标记。如果它们不匹配,您将无法在初始化中设置外部上下文。这也应该与类声明之前的 RemoteClass 描述符中的别名匹配。我希望这是有用的信息。

【讨论】:

    【解决方案2】:

    在我的情况下,发生的事情是缺少运行 c++ 代码所需的 MSVCR(Microsoft Visual c++ 再分发)。
    由于扩展程序中的代码无法运行,应用程序找不到 ANE 中包含的任何功能。
    确保您的 ANE 代码能够通过编写日志或独立运行一些示例本机代码来运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-02
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      • 2014-06-06
      • 2020-12-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多