ios - Air to iPad Release Build Assets 加载失败

标签 ios air flash-builder

在运行 Air IOS Ipad 应用程序的发布版本时遇到一些问题(基于 starling)。

我正在进行发布构建,并将 ipa 文件保存在我的驱动器上。我双击 ipa 将其导入 iTunes,然后将应用程序安装到 iPad 上。

在 iPad 上后,应用程序无法加载任何外部文件。 我设置了一个预加载器,并尝试通过 Loadermax 加载资源,但是似乎失败了。

这是应用程序失败的代码部分:(注意:这一切都在 Debug模式下工作,无论是在 Air 模拟器中,还是通过 USB 在设备上的 Debug模式下)

import com.greensock.events.LoaderEvent;
import com.greensock.loading.ImageLoader;
import flash.filesystem.File;
 ...
 ...
var _imageLoader:ImageLoader;
 ...
 ...
private function loadAssets():void{
  var _appFile:File = File.applicationDirectory;
  _appFile = _appFile.resolvePath("assets/statics/blueImage.png");
  _imageLoader = new ImageLoader(_appFile.nativePath, {onComplete:onImageLoaded, onFail:onImageLoadFail});
}
private function onImageLoaded(e:LoaderEvent):void{
  traceOut("OH MY GOD BATMAN, IT WORKED!!!");   // traceOut is a helper method that prints to a textfield on the display
}
private function onImageLoadFail(e:LoaderEvent):void{
  traceOut("back to the Bat Cave...");
}
...
...

在 Debug模式下,上面的代码显示:

OH MY GOD BATMAN, IT WORKED!!!

在发布版本中:

back to the Bat Cave...

有人知道我哪里出轨了吗?我没有使用任何 ANE 之类的。
基于SDK:“http://ns.adobe.com/air/application/14.0

最佳答案

PC 不区分大小写,但 Ios 区分大小写。在模拟器或 Debug模式下,文件名“myFile”可以工作,即使它实际上是“myfile”(注意上限差异),在 Release模式下它也会失败。

如果这不起作用,请尝试使用 File 的 url 属性而不是 nativePath。您还可以在加载之前轻松检查文件是否存在:

if(_appFile.exist)

此外,当依赖自定义框架时,您会强制自己依赖它们的缺点。使用经典 Loader 实例重复相同的操作,看看是否成功。您会惊讶地发现自定义框架在简单操作上失败的次数仅仅是因为它的内部设置方式。

关于ios - Air to iPad Release Build Assets 加载失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24582422/

相关文章:

objective-c - 与不显示我的 UIWindow 的 Xcode 作斗争

actionscript-3 - 执行 Flashbuilder 应用程序导致错误 2148 只有 local-with-filesystem 和受信任的本地 SWF 文件可以访问本地资源

apache-flex - flex 4.6 pom 文件依赖没有解决

actionscript-3 - flex 中的动画 GIF

ios - firebaseobserveSingleEvent 在 swift 中已弃用

ios - 如何使用 Alamofire 4.0 post 请求快速发送表单数据

actionscript-3 - Flex 4.6 编译器检查是否为 ios 或 android 编译

ios - 两个错误——二进制未针对 iphone 5 优化(错误 90096)和无效代码签名(错误 90163)——提交到 iTunes 时

android - AdMob:过滤 child 广告

actionscript-3 - 如何在 Adob​​e AIR 本地 SQL 中存储 byteArray?