【发布时间】:2016-09-19 01:39:03
【问题描述】:
我正在尝试在 ADL 命令行调试器下运行我的 AIR 应用程序,包括 third party native extension(我没有使用诸如 FlashDevelop 之类的 IDE)。我的应用适用于 Windows 桌面计算机。
编译似乎没有问题:
$ amxmlc src/menustatemain.as
-o src/menustatemain.swf
-compiler.include-libraries C:\Users\Me\Downloads\AIRSDK_Compiler\frameworks\libs\player\21.0\playerglobal.swc
-external-library-path+=extensions\ane\NativeJoystick.swc
-use-network=false
-verbose-stacktraces=true
-debug=true
-advanced-telemetry
-omit-trace-statements=false
-define=CONFIG::debug,false
-define=CONFIG::test,true
Loading configuration: C:\Users\Me\Downloads\AIRSDK_Compiler\frameworks\air-config.xml
3383030 bytes written to C:\Users\Me\Documents\myproject\src\menustatemain.swf in 17.069 seconds
但是,当我尝试在 ADL 下运行应用程序时,它会失败并出现以下错误:
$ adl
-extdir extensions\ane_unzipped
-profile extendedDesktop
menustatemain.xml
VerifyError: Error #1079: Native methods are not allowed in loaded code.
我已经用谷歌搜索了,但我尝试过的都没有解决这个问题。 StackOverflow 上有几个类似的问题,它们的答案并不能解决我的问题。我已经更改了我能找到的所有设置,以便在编译时动态链接扩展并在运行时加载它。我有一种预感,这可能是扩展程序本身的问题,但我不知道如何验证。
如何调试这个问题?
对于上下文,这是menustatemain.xml的内容:
<application xmlns="http://ns.adobe.com/air/application/21.0">
<id>com.me.MyProject</id>
<versionNumber>1.0</versionNumber>
<filename>MyProject</filename>
<initialWindow>
<content>MyProject.swf</content>
<visible>true</visible>
<width>640</width>
<height>480</height>
<maximizable>false</maximizable>
<resizable>false</resizable>
</initialWindow>
<supportedProfiles>extendedDesktop</supportedProfiles>
<extensions>
<extensionID>com.iam2bam.ane.nativejoystick</extensionID>
</extensions>
</application>
另外,我在项目子目录中有本地扩展的已编译和未编译版本:
C:\Users\Me\Documents\myproject
extensions\
ane\
NativeJoystick.ane
NativeJoystick.swc
ane_unzipped\
NativeJoystick.ane\
META-INF\
...
【问题讨论】:
-
听起来
adl选择了错误的Playerglobal.swc或错误的版本。 -
我通过
-compiler.include-libraries C:\Users\Me\Downloads\AIRSDK_Compiler\frameworks\libs\player\21.0\playerglobal.swc指定它。您认为指定不同的版本会有所帮助吗?我怎么知道要使用哪个版本? -
我“假设”您正在编译的播放器是自 21.0 目录以来的正确播放器。我说的是
adl。这是从 21.0 开始运行的吗?即设置-runtime选项是否可以修复您的 #1079 错误?通常,每当我看到该错误时,adl来自错误的版本和/或它没有选择正确的播放器 swc,因此它会失败,因为它选择的播放器囊是闪光的,而不是基于空气的。 .. 另外,当您将应用程序打包到本机 air 安装程序中时会发生什么,它运行正常吗?
标签: flash apache-flex actionscript air