适用于 Android 的 Adob​​e Air 3.0 ANE,ExtensionContext 为 null?

发布于 2024-12-14 04:02:45 字数 482 浏览 0 评论 0原文

我一直在使用 Adob​​e for Air 3.0 在 Android 上的本机扩展的振动示例。

我已经编译了 ANE 并打包了 .apk。

我遇到的问题是actionscript 库得到一个空的ExtensionContext。

我尝试使用 adt -package -target apk-debug 创建 .apk,以便我可以在 logcat 中看到动作脚本跟踪,这就是我发现空错误的地方。

extContext = ExtensionContext.createExtensionContext("com.adobe.Vibration", null);

extContext 为 null 并在执行以下 .call() 方法时崩溃。

所有来源均来自示例,我没有更改任何内容。

有谁有在 Windows 计算机上运行 Adob​​e 的 ANE 示例之一的经验吗?大多数示例适用于 Mac。

I've been working with the vibration example from Adobe for Air 3.0's native extensions on Android.

I have the ANE compiled and the .apk packaged.

The problem I'm having is the actionscript library is getting a null ExtensionContext.

I tried creating the .apk with adt -package -target apk-debug so that I can see the actionscript traces in logcat and that's where I'm finding the null error.

extContext = ExtensionContext.createExtensionContext("com.adobe.Vibration", null);

extContext is null and crashes on the following .call() method.

All of the source is stock from the examples, I haven't changed anything.

Does anyone have any experience with getting one of Adobe's ANE examples working on a windows machine? Most of the examples are for Mac.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浅沫记忆 2024-12-21 04:02:45

好主啊。真是浪费了一个星期。

我正在使用 gotoandlearn.com 的教程,该教程告诉我在构建脚本中使用 jar 命令将我的本机扩展放入 jar 中。

我只是使用了 NativeAndroid/bin/ 文件夹中自动构建的 .jar,一切都很好。

事实证明,该教程已经过时,对于构建不再真正有用。

Good lord. What a waste of a week.

I was using a tutorial from gotoandlearn.com that was telling me to, in by build script, use a jar command to put my native extension in to a jar.

I simply used the .jar that's automatically built in the NativeAndroid/bin/ folder and all is well.

It turns out, that tutorial is out dated and not really useful for the build anymore.

另一条评论。您需要从“属性”->“设置目标平台”和“是库”复选框Android 在 bin 文件夹中获取编译后的 jar。

来自 gotoandlearn 的 PS .sh 可以在 Windows 中的 Powershell 中执行,只需对运行 bat 文件进行少量更改:( cmd "/c adt.bat" )

One additional comment. You need to set target platform and checkbox Is Library from Properties -> Android to get compiled jar in bin folder.

P.S. .sh from gotoandlearn can be executed in Powershell in Windows with minor changes for running bat files: ( cmd "/c adt.bat" )

焚却相思 2024-12-21 04:02:45

我在我正在编写的本机扩展上遇到了完全相同的问题,并且已经开源。我使用 Adob​​e DevNet 的教程代码开始了这个项目。我找到了这个特定问题的例子,我试图完全遵循,但还没有成功。我已确定这是沙箱允许域问题。

这是我的代码行:

_aneContext = ExtensionContext.createExtensionContext("com.adobe.sampleasextension", "");

这是我的 GitHub 项目中代码的链接:

https://github.com/interactivenyc/ANESampleProject/blob/master/TEST_AndroidAIR/src/ANESampleTest.as

这是我的编译器错误:

SecurityError: Error #3207: Application-sandbox content cannot access this feature.
    at flash.system::Security$/allowDomain()
    at com.adobe.sampleasextension::SampleASExtension()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/ANESampleSWC/src/com/adobe/sampleasextension/SampleASExtension.as:14]
    at ANESampleTest/initializeANE()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:198]
    at ANESampleTest/onAddedToStage()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:131]
    at runtime::ContentPlayer/loadInitialContent()
    at runtime::ContentPlayer/playRawContent()
    at runtime::ContentPlayer/playContent()
    at runtime::AppRunner/run()
    at AppEntryCommon/run()
    at global/runtime::AndroidMobileDeviceAppEntry()

I'm having the exact same problem on a Native Extension I'm writing, and have open sourced. I started this project with tutorial code from Adobe DevNet. I've found examples of this specific issue I've tried to follow exactly, and have had no luck with it yet. I've identified it to be a sandbox allow-domain problem.

Here's my line of code:

_aneContext = ExtensionContext.createExtensionContext("com.adobe.sampleasextension", "");

Here is a link to the code in my GitHub project:

https://github.com/interactivenyc/ANESampleProject/blob/master/TEST_AndroidAIR/src/ANESampleTest.as

Here is my compiler error:

SecurityError: Error #3207: Application-sandbox content cannot access this feature.
    at flash.system::Security$/allowDomain()
    at com.adobe.sampleasextension::SampleASExtension()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/ANESampleSWC/src/com/adobe/sampleasextension/SampleASExtension.as:14]
    at ANESampleTest/initializeANE()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:198]
    at ANESampleTest/onAddedToStage()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:131]
    at runtime::ContentPlayer/loadInitialContent()
    at runtime::ContentPlayer/playRawContent()
    at runtime::ContentPlayer/playContent()
    at runtime::AppRunner/run()
    at AppEntryCommon/run()
    at global/runtime::AndroidMobileDeviceAppEntry()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文