我开始使用新的flex英雄sdk将这个flex应用程序转换为在android上运行.我已经替换了所有与移动设备不兼容的组件,并使其成功运行了几次.
当我使用运行原始web应用程序的相同库时,它可以很好地工作.
然而,最大的问题是在启动移动应用程序时这些随机的无效BitMapdata错误.这是整个输出.
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData/ctor()
at flash.display::BitmapData()
at spark.primitives::BitmapImage/http://www.adobe.com/2006/flex/mx/internal::applySource()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\BitmapImage.as:1337]
at spark.primitives::BitmapImage/http://www.adobe.com/2006/flex/mx/internal::validateSource()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\BitmapImage.as:1652]
at spark.primitives::BitmapImage/commitProperties()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\BitmapImage.as:902]
at spark.primitives.supportClasses::GraphicElement/validateProperties()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\supportClasses\GraphicElement.as:3487]
at spark.components::Group/commitProperties()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\components\Group.as:931]
at mx.core::UIComponent/validateProperties()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\core\UIComponent.as:8095]
at mx.managers::LayoutManager/validateProperties()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\managers\LayoutManager.as:597]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\managers\LayoutManager.as:760]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1157]
Run Code Online (Sandbox Code Playgroud)
我调试了很多次,我发现它到达这个方法时
mx_internal function applySource():void
{
Run Code Online (Sandbox Code Playgroud)
在BitmapImage.as中,在此声明中
if (!bitmapData && tmpSprite)
Run Code Online (Sandbox Code Playgroud)
bitmapData == null.但是,当我运行原始web应用程序时,bitmapData不为null.应该在这行代码中确定bitmapData值
<s:BitmapImage id="smallTriangle" smooth="true" source="@Embed('/com/xploreplus/components/containers/panel/assets/images/smallTriangle.png')" />
Run Code Online (Sandbox Code Playgroud)
现在在我看来,运行移动应用程序,它无法找到图像,因为当我运行webapplication时,使用上面代码行所在的相同库,它能够找到图像.
这个问题一直困扰着我好几天,我真的开始认为这是一个错误,特别是因为它有时会运行.或者我在这里缺少一些东西.