- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
多年来,我一直在使用 AIR for iOS 来构建在本地下载 HTML 文件并通过 stageWebView 加载它们的 iOS 应用程序,直到 AIR 26 发布。它停止从 documentsDirectory 加载本地 html。我收到以下错误消息 -
stagewebview.loadURL(path) returns an error - not able to reach location:[ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="The operation couldn't be completed. (kCFErrorDomainCFNetwork error 1.)" errorID=3228]
我尝试过使用这两种方法来获取文件路径,但都返回了上述错误。就是找不到本地保存文件的位置-
1.
var destination:File = File.documentsDirectory.resolvePath("29/index.html");
var fp = destination.nativePath;
path = "file://" + fp;
webView.loadURL(path);
2.
var destination:File = File.documentsDirectory.resolvePath("29/index.html");
path = new File(destination.nativePath).url;
webView.loadURL(path);
我什至尝试将 url 文件方案更改为“file://”、“file:///”和“file://”//”,但它们都找不到 AIR26 和 AIR 27 beta 中保存在 documentsDirectory 中的文件。该代码适用于 AIR 25 及以下版本。
我尝试从 applicationStorageDirectory 加载 html,但它也找不到 html 文件。
这是文档目录中的文件路径 -file:///var/mobile/Containers/Data/Application/device-specific-code/Documents/29/index.html
我很困惑,为什么相同的代码适用于 AIR 25 及更低版本,但自 AIR 26 起就停止工作了。
我到处搜索,找不到任何真正的答案。
任何见解/解决方案/解决方法都非常感谢。
谢谢!
最佳答案
不是解决方案,只是解决方法:使用 Air 版本 25。Since version 26 Adobe uses WKWebView instead of UIWebView至少在它们的实现中,这意味着无法加载本地文件。幸运的是,使用 AIR 25 编译的应用程序可以在 iOS 11 上运行。
关于ios - 适用于 iOS 26+ StageWebView 的 Adobe AIR 不会从 documentsDirectory 加载本地 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45642784/
我正在使用 Flash Builder、Flex 4.6 和 AIR 3.5 为 IOS 构建一个移动应用程序。我正在调查使用 StageWebView 呈现一些 HTML5 内容。 我想做的是将内容
StageWebView Flash 显示时为白色 所以我一直在使用 Adobe Animate 创建一个通用 Air 应用程序,该应用程序可以移植到多个平台,即 Mac、Windows 和 iO
我在 Flex Mobile 4.6 (Flash Builder 4.6) 上显示 StageWebView 时遇到问题,当我动态创建它时,事件被正确调用但没有任何内容可见,这是我的代码:
我有一个在 Flash Builder/Flex Mobile Project 中开发的 iphone 应用程序,它使用 stagewebview 显示 PDF。 我有兴趣从应用程序打印这些 PDF。
我正在考虑在我的 iOS 应用程序中实现 Web View ,但我还没有找到关于 StageWebView 使用什么浏览器的任何引用。 我怀疑浏览器会因使用的系统而异。所以,在 iOS 上它应该是 S
当通过 StageWebView Air 组件加载 Youtube 视频时,我需要将视频缩小到视口(viewport)大小,显示黑条是可以的,但我最终看到的是视频原始大小的裁剪版本。 我没有看到任何可
我在 Android 设备的 StageWebView 中读取视频时遇到问题。 我使用 html5 视频标签,我想在 Android 应用程序的 StageWebView 中阅读此视频。 对于 iOS
我正在使用 Adobe Flash Professional CS5.5 通过 AIR 3 构建 iPhone 应用程序。 我正在实现 FacebookMobile flash API,它使用 S
我打开一个视频以在 StageWebView 中播放: var webView:StageWebView = new StageWebView(); var path:String = 'h
在我的应用程序(flash + away3d 4 + adobe air 3.2 for iPad)中,我有一个 View3D,其中包含一些正确显示的对象。当我触摸一个特定的对象时,它会启动一个包含以
我想使用 StageWebView 类将 Leaflet Map 合并到 ios 和 android air 移动应用程序中。不幸的是, map 图像的质量参差不齐,很难辨认出街道名称。似乎有一些小的
我能够 usb remote debug运行 4.4.x 的 Android Galaxy Note 2 上的 Adobe Air 应用程序中的 StageWebView。这是来自运行 Maver
我有以下问题。 使用Flex 4.6在IOS上开发APP 我正在将解析的 epub 文件显示到 stagewebview 中。它在设备上运行良好。但是,当我尝试添加注释工具(如ibook注释)时,我只
我正在尝试使用 StageWebView 来显示使用 Javascript API 生成的 Google Maps map 。有什么原因导致它无法在 iOS 上呈现吗?它适用于 Android 和 A
我在 AIR 3.9 中打开一个 StageWebView 编译为 ipa 以在 iPad2 上使用。如果有帮助的话,我还在后台运行 Starling 框架。 这是我的代码: _webView = n
我正在尝试使用 Flash Pro CS5.5 为 iOS 构建一个应用程序,我需要在我的一个页面上实现一个简单的视频,但我无法控制它。经过几个小时的谷歌搜索后,我终于设法让一个视频正常运行并顺利运行
我已经安静地处理这个问题有一段时间了。我现在可以从 AS 内的 Javascript 访问值。但我面临着几个问题: 首先,首次打开 map 时,我无法将 map 置于用户位置的中心。它在 HTML 文
当我双击 iPhone 上的 StageWebView 时,即使我在 Stage Resize 事件中重置视口(viewport),它的视口(viewport)似乎也会调整大小(缩小): WView.
多年来,我一直在使用 AIR for iOS 来构建在本地下载 HTML 文件并通过 stageWebView 加载它们的 iOS 应用程序,直到 AIR 26 发布。它停止从 documentsDi
我正在开发一个 AIR Android 应用程序,我需要在其中实现 map 。环顾四周后,我决定使用 StageWebView 类的 Google Maps API for Javascript。当我
我是一名优秀的程序员,十分优秀!