将AIR应用程序部署到Android设备时出现参考错误

问题描述:

我的Android设备的Adobe AIR应用程序出现问题。在PC上运行SWF文件时,应用程序运行良好,我也在Adobe Device Central中测试了它,并且按预期工作。当我安装这个应用程序到我的Android设备,HTC Desire HD时,我得到一个5点的屏幕,看起来像一个加载屏幕。将AIR应用程序部署到Android设备时出现参考错误

我检查了logcat,看看发生了什么,似乎有几个参考错误。有没有人对如何解决这些问题有任何建议?

我使用下面的命令

adt -package -target apk-debug -storetype pkcs12 -keystore game.p12 game.apk game-app.xml game.swf icon36.png icon48.png icon72.png 

这是我的XML文件的内容

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
<application xmlns="http://ns.adobe.com/air/application/2.5"> 
<id>com.example.game</id> 
<versionNumber>1.0.0</versionNumber> 
<filename>game</filename> 
<name>game</name> 
<copyright>me</copyright> 
<initialWindow> 
<content>game.swf</content> 
<visible>true</visible> 
<fullScreen>true</fullScreen> 
<autoOrients>false</autoOrients> 
<aspectRatio>landscape</aspectRatio> 
<renderMode>gpu</renderMode> 
</initialWindow> 
<customUpdateUI>false</customUpdateUI> 
<allowBrowserInvocation>false</allowBrowserInvocation> 
<icon> 
<image36x36>icon36.png</image36x36> 
<image48x48>icon48.png</image48x48> 
<image72x72>icon72.png</image72x72> 
</icon> 
<android> 
<manifestAdditions><![CDATA[<manifest> 

    <uses-permission android:name="android.permission.WAKE_LOCK"/> 

</manifest> 
]]></manifestAdditions> 
</android> 
<versionLabel></versionLabel> 
</application> 

这是从我的logcat输出创建的应用程序

I/air.com.example.game(2623): rsl error! 
I/air.com.example.game(2623): numComplete 0 
I/air.com.example.game(2623): numFailed 0 
I/air.com.example.game(2623): numComplete 0 
I/air.com.example.game(2623): failedURLs: 
I/air.com.example.game(2623): http://fpdownload.adobe.com/pub/swz/tlf/1.0.0.595/textLayout_1.0.0.595.swz 
I/air.com.example.game(2623): textLayout_1.0.0.595.swz 
I/air.com.example.game(2623): VerifyError: Error #1014: Class flashx.textLayout.container::ContainerController could not be found. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable introScreen_18 is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable endScreen_1 is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable TextInput is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable TextInput_upSkin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable TextInput_disabledSkin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable focusRectSkin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button_upSk 
in is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button_selectedUpSkin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button_selectedOverSkin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button_selectedDownSkin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button_selectedDisabledSkin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button_over 
Skin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button_emphasizedSkin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button_down 
Skin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Button_disabledSkin is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable ComponentShim is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Explosion i 
s not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Laser is no 
t defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Enemy is no 
t defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Player is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Explode is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable Font_56 is not defined. 
I/air.com.example.game(2623): 
I/air.com.example.game(2623): ReferenceError: Error #1065: Variable MainTimeline is not defined. 
I/air.com.example.game(2623): 

你”我有一个RSL错误。您可能需要使用APK打包.swz文件。

转到actionscript设置运行时共享库​​设置并选择合并到代码中。

我是有非常相似的输出此相同的问题:

Fonts should be embedded for any text that may be edited at runtime, other than text with the "Use Device Fonts" setting. Use the Text > Font Embedding command to embed fonts. 
rsl error! 
numComplete 0 
numFailed 0 
numComplete 0 
failedURLs: 
    http://fpdownload.adobe.com/pub/swz/tlf/1.0.0.595/textLayout_1.0.0.595.swz 
    textLayout_1.0.0.595.swz 
VerifyError: Error #1014: Class flashx.textLayout.container::ContainerController could not be found. 

ReferenceError: Error #1065: Variable soldsign_24 is not defined. 

ReferenceError: Error #1065: Variable Font_4 is not defined. 

Error opening URL 'http://fpdownload.adobe.com/pub/swz/crossdomain.xml' 

我最终要去除与“可变soldsign_24”和“Font_4”按照上面的代码相关联的对象。这解决了编译错误,我能够挽救我的工作。我相信这发生在我身上,因为我使用的字体没有正确链接。希望有所帮助:)