适用于 Android 的 Adobe Air 3.0 ANE,ExtensionContext 为 null?
我一直在使用 Adobe 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 计算机上运行 Adobe 的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好主啊。真是浪费了一个星期。
我正在使用 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" )
我在我正在编写的本机扩展上遇到了完全相同的问题,并且已经开源。我使用 Adobe DevNet 的教程代码开始了这个项目。我找到了这个特定问题的例子,我试图完全遵循,但还没有成功。我已确定这是沙箱允许域问题。
这是我的代码行:
这是我的 GitHub 项目中代码的链接:
https://github.com/interactivenyc/ANESampleProject/blob/master/TEST_AndroidAIR/src/ANESampleTest.as
这是我的编译器错误:
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:
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: