问题标签 [on-demand-resources]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
375 浏览

ios - xcodebuild 存档失败,但创建了 xcarchive

我最近开始在我的项目中使用按需资源。为了支持它,我更改了构建脚本,现在我首先创建一个存档,然后将其导出到 ipa。这是我正在使用的命令 xcodebuild -project ABC.xcodeproj/ -configuration Debug -scheme "ABC" archive -archivePath bin/debug/ABC.xcarchive xcodebuild -exportArchive -archivePath bin/debug/ABC.xcarchive -exportPath bin/debug - exportOptionsPlist ABC/content/Info_debug.plist

当我执行第一个命令构建运行顺利但最后它显示

创建AssetPackManifestPlist

创建 AssetPackManifest.plist

** 存档失败 **

没有错误日志或任何其他显示任何问题的指示。即使它显示归档失败 xcarchive 文件已创建并且我能够使用它成功导出到 ipa。我还安装并验证了 ipa ,应用程序运行良好。所以我将命令修改为 xcodebuild -project AMC.xcodeproj/ -configuration Debug -scheme "ABC" archive -archivePath bin/debug/ABC.xcarchive || exit 0 现在一切正常,但我仍然不确定为什么命令显示“存档失败”。这可能是什么原因,即使显示存档失败,也可以将其导出到 ipa。

0 投票
1 回答
371 浏览

ios - beginAccessingResources 不会第二次开始下载进度

我开始在我的应用程序中使用 ODR。

该代码适用于正常情况,但以下情况除外:

当下载过程中断时(按 Home 键),NSBundleResourceRequest. beginAccessingResources在第二次变得永远不会完成。在调试中,磁盘使用情况:应用程序处于保持Downloading状态。

这是我的代码:

该文档非常简单,但找不到有关此问题的任何帮助。

有人会帮助我吗?谢谢。

0 投票
1 回答
546 浏览

ios - 未为特定设备下载按需资源

第三次命运让我对 Apple 的内容托管提出了挑战,而这一次我遇到了仅在一个特定设备上的按需资源问题。

我们有一个应用程序,它在商店中提供按需资源支持。目前,我们正在进行更新,其中有必要添加一些内容以使用按需资源加载。添加资源并将构建上传到 ITC 后,我可以看到所有资产包。在 iPhone 6s 和三台 iPhone 8 上测试了按需资源下载后,我发现在一台 iPhone 8 上根本无法进行按需资源下载。预取的标签以及常规标签都会返回错误,我可以看到出了点问题。

iPhone 6s、两部 iPhone 8 和另一部 iPhone 8 之间的唯一区别是最后一部目前在澳大利亚。按需资源下载能否依赖于语言环境?如果是这样,如果该应用程序适用于全世界,为什么会发生这种情况?

有没有人有类似的问题?谢谢。

0 投票
0 回答
55 浏览

ios - 首次启动时流式传输/下载大数据的最佳方式

这是我的难题:我有一个 WalkthroughViewController,它出现在应用程序的第一次启动时。该应用程序本身具有大量功能,需要对普通webdev初学者进行一些解释。

我设法创建了 4 个视频来快速总结应用程序及其工具。这些视频是 1080p 的屏幕截图,大小约为147MB

我知道有几个不同的选项,其中一个特别突出:将视频压缩到较低的分辨率并在演练后删除内容。

但是,在这种情况下,我希望尽可能保持最高质量的视频。该应用程序的演练效果非常好,虽然它在启动时确实占用了 147MB,但高清屏幕捕获确实将整个过程融合在一起,使其看起来很专业。过去,我使用 480p 视频进行演练介绍,它看起来像是低质量的录音。然而,本演练中使用的 1080p 视频看起来栩栩如生——就好像应用程序在他们眼前实现了自动化。

最后,我的问题是:假设压缩(或至少“降低质量压缩”)不在等式中,您将如何在演练中实施这些视频?

编辑:缓冲屏幕/下载进度视图是可能的(直到内容被下载),假设等待不超过荒谬的时间。

0 投票
1 回答
613 浏览

c# - 如何在 Unity 中暂停、恢复和取消活动的 OnDemandResourcesRequest?

我在 Unity 中遇到了 ODR(按需资源)的一些问题。当我使用 OnDemandResourcesRequest 下载一些资源并且它正在进行中时,我只是通过滑动它或移动到后台来杀死应用程序,我发现下载没有任何进展。这里的痛苦情况是,它再也不会恢复。

从 TestFlight 下载后,我正在 iPhone 6s 上对其进行测试。我的应用程序是用 C# Unity 构建的。

在 Objective C 中,NSProgress 中有一个方法允许暂停、恢复和取消活动的按需资源下载。但我在 Unity 中找不到这样的方法。

参考: https ://developer.apple.com/library...ptual/On_Demand_Resources_Guide/Managing.html

谁能帮我找到在 Unity (OnDemandResourcesRequest) 中恢复、暂停和取消当前下载的方法?

0 投票
1 回答
1395 浏览

unity3d - 为什么在 iPad 中由于缺少内存而在下载和解包结果后将 AssetBundle 加载到内存中崩溃?

我们刚刚在 Unity 2D 中完成了一个 2D 游戏,但正在努力解决一些与内存相关的严重问题。

使用的 Unity 版本:Unity 2017.2.2f1

我们正在使用 AssetBundles 和 On Demand Resource 下载每个平均大小为 20MB 的包(纹理、精灵表、bg 图像和场景)。

我们已经成功地将我们的应用商店大小限制为 90MB。在 Xcode 中分析项目时,构建占用的初始内存为 180 MB。但是现在当我们通过按需资源下载任何级别(资产包)时问题就开始了。内存使用量从 180MB 跃升至 568MB。

1.为什么unity在下载加载20MB大小的AssetBundle后会消耗388MB内存?

2.为什么每次我们加载一个新场景,unity卸载场景后都会保留一些内存,即不清除分配的块?

3. RGBA Compressed PVRTC 4 bits 在 Unity 中是否适用于 iOS 设备?

5.Unity有没有第三方SDK来压缩2D Textures和GUI Graphics?

请帮助我,以便我可以以其他方式将项目交付给客户,我的工作处于危险之中:(

提前致谢 。

0 投票
1 回答
419 浏览

swift4 - iOS正在清除按需下载的mp3资源,如何防止这种情况?

iOS 将在需要释放一些空间时在下载后清除资产。

更改资产的保存优先级不会阻止系统清除它们,如此处“设置保存优先级”部分所述

我下载按需资源的相关代码如下:

下载 On-Demand 资源后,可以从主包中访问它们。

有没有办法让音频持续存在,从而阻止系统清除它们?

0 投票
2 回答
630 浏览

ios - On Demand Resource AppStore Upload Failure in iOS application - Disallowed Paths

I have an application using ARKit. Till the current build, all assets were included in the app bundle itself and there seem to be no issue for users in using the application.

However, I wanted to enable On-Demand Resource on the app so that newer modules (games)'s resources could be downloadable from AppStore, thus obviating heavy app size. Following the iOS documentations, I was able to use ODR and the application was working all right on my device. It was loading resources using ODR as it should.

When uploading to AppStore for App Review, however, I encountered the error:

enter image description here

My folder structure for the specific SCNAssets folder (which is tagged) is below:

enter image description here

Please note that the app works perfectly using ODR on my device. I have done the following and tried multiple times, but to no avail.

  1. Creating a clean build.
  2. Changing the Version/ Build.
  3. Making sure ODR is enabled in Build Settings, etc. - all hygienic steps.And it's all XCode, there is no platform which I am using (such as Xamarin, etc.)
  4. Using existing SO related solutions.

There is not much documentation by Apple on issues related to AppStore upload for ODR enabled applications. I am wondering whether within the tagged resource folder, we can have other folders as well or not, as my folder structure is right now - not sure whether this can be the reason, since the error attached points to all the folders within my folder structure.

Help would be much appreciated. For now, I remove my reliance on ODR and built w/o it, however this cannot be sustained for long. Note: The assets are all scn files, scn particle systems and images.

Code to access ODR is below (with brevity), however it the code works with my device it should work elsewhere. I think the issue might be related to folder arrangement.

ODR Manager:

Accessing ODR within ViewController

0 投票
1 回答
100 浏览

xcode - 应用内购买/按需资源

当资源包含在应用程序中时,将按需资源与 iOS 应用内购买结合使用是可以理解的。但是,在应用程序上架后,如何添加额外的应用程序内购买?我不是指在 iTunesConnect 中创建新的应用内购买的过程。

我试图了解我是否为原始应用程序上的新应用内购买创建目标并将目标上传到应用商店,如果该数据可用作应用内购买。WWDC 视频表明有两种托管应用内购买的方式:按需资源和托管内容。两者的上传过程是否相同?

0 投票
1 回答
268 浏览

ios - 为什么 beginAccessingResourcesWithCompletionHandler 会抛出意外的状态异常

我从我的应用程序的用户那里收到了一些关于按需资源的崩溃日志。它们很少发生,我找不到重现问题的方法。

崩溃的原因是

我和谷歌都没有任何线索。