菜鸟教程小白 发表于 2022-12-11 20:09:44

ios - iOS 应用程序中的按需资源 AppStore 上传失败 - 不允许的路径


                                            <p><p>我有一个<strong>使用 ARKit 的应用程序</strong>。在当前构建之前,所有 Assets 都包含在应用程序包本身中,用户使用该应用程序似乎没有问题。</p>

<p>但是,我想在应用程序上启用<strong>按需资源</strong>,以便可以从 AppStore 下载较新的模块(游戏)的资源,从而避免过重的应用程序大小。根据 iOS 文档,我能够使用 ODR,并且该应用程序在我的设备上运行良好。它应该使用 ODR 加载资源。 </p>

<p>然而,在上传到 AppStore 进行 App Review 时,我遇到了错误:</p>

<p> <a href="/image/sY2AI.png" rel="noreferrer noopener nofollow"><img src="/image/sY2AI.png" alt="enter image description here"/></a> </p>

<p>我的特定 SCNAssets 文件夹(已标记)的文件夹结构如下:</p>

<p> <a href="/image/qU2Km.png" rel="noreferrer noopener nofollow"><img src="/image/qU2Km.png" alt="enter image description here"/></a> </p>

<p>请注意,该应用在我的设备上使用 ODR 可以完美运行。我做了以下并尝试了多次,但没有成功。</p>

<ol>
<li>创建一个干净的构建。 </li>
<li>更改版本/构建。</li>
<li>确保在build设置等中启用了 ODR - 所有卫生步骤。而且它是
所有 XCode,没有我正在使用的平台(例如 Xamarin,
等)</li>
<li>使用现有的 SO 相关解决方案。</li>
</ol>

<p>对于启用 ODR 的应用程序的 AppStore 上传相关问题,Apple 提供的文档不多。我想知道在标记的资源文件夹中,我们是否也可以有其他文件夹,因为我的文件夹结构现在是 - 不确定这是否是原因,因为附加的错误指向我的文件夹结构中的所有文件夹. </p>

<p><strong>非常感谢您的帮助。</strong> 目前,我消除了对 ODR 的依赖并在构建时不使用它,但是这不能持续很长时间。
注意: Assets 都是scn文件、scn粒子系统和图片。 </p>

<p>访问 ODR 的代码如下(简洁),但是该代码适用于我的设备,它应该适用于其他地方。我认为这个问题可能与文件夹排列有关。 </p>

<p><strong>ODR 经理:</strong></p>

<pre><code>class ODRManager {

    static let shared = ODRManager()
    var currentRequest: NSBundleResourceRequest?
    var currentProgressFractionCompleted: Double?

    func requestSceneWith(tag: String, onSuccess: @escaping () -&gt; Void, onFailure: @escaping (NSError) -&gt; Void) {

      currentRequest = NSBundleResourceRequest(tags: )

      guard let request = currentRequest else { return }

      request.beginAccessingResources { (error: Error?) in
            if let error = error {
                onFailure(error as NSError)
                return
            }
            onSuccess()
      }
    }
}
</code></pre>

<p><strong>在 ViewController 中访问 ODR</strong></p>

<pre><code>// tagName is the name of the tag on the ODR related scnassets folder.

ODRManager.shared.requestSceneWith(tag: tagName, onSuccess: {
    DispatchQueue.main.async {
      self.game = self.gameFactory.createGame(...)
}, onFailure: { (error) in
    self.threeSurfaceLabel.text = &#34;Problem with downloading content. Make sure internet connection is working, and restart.&#34;
})
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>仔细查看错误信息后,您可以看到错误只是引用了 .DS_Store 文件。</p>

<p>.DS_Store 文件是查找器创建的隐藏文件,用于存储每个文件夹的演示设置。</p>

<p>解决方案是在构建之前删除项目子目录中的所有 .DS_Store 文件。</p>

<ol>
<li>关闭 Xcode</li>
<li>打开终端并 cd 到您的项目目录</li>
<li>键入 find 。 -name '.DS_Store' -type f 删除</li>
<li>打开 Xcode,加载您的项目,清理、重建、归档并上传到 AppStore。</li>
</ol></p>
                                   
                                                <p style="font-size: 20px;">关于ios - iOS 应用程序中的按需资源 AppStore 上传失败 - 不允许的路径,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/50343132/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/50343132/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - iOS 应用程序中的按需资源 AppStore 上传失败 - 不允许的路径