【问题标题】:ARCore Extensions for AR Foundation (Unity) — Error Upon BuildAR Foundation (Unity) 的 ARCore 扩展 — 构建时出错
【发布时间】:2021-06-24 18:11:05
【问题描述】:

我正在尝试构建一个使用 ARCore 的 Cloud Anchors for AR Foundation 的应用程序。当我将 ARCore Extensions 对象添加到场景并构建时,我收到以下错误。非常感谢帮助/见解。 (我正在为 Android 构建。)

ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Google.XR.ARCoreExtensions.Editor.Internal.AndroidDependenciesHelper.GetAllSessionConfigs () (at Packages/arcore-extensions-package/Editor/Scripts/Internal/AndroidDependenciesHelper.cs:65)
Google.XR.ARCoreExtensions.Editor.Internal.CompatibilityCheckPreprocessBuild.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Packages/arcore-extensions-package/Editor/Scripts/Internal/ModulesWorkflow/CompatibilityCheckPreprocessBuild.cs:66)
UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass15_0.<OnBuildPreProcess>b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at <0b8db76a688c4d18a15dd7dfe092a035>:0)
UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at <0b8db76a688c4d18a15dd7dfe092a035>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

【问题讨论】:

    标签: unity3d augmented-reality arcore


    【解决方案1】:

    好的,我很快就解决了这个问题。

    ARCoreExtensions 对象有 4 个必填字段 listed here。除了 ARCore Extensions Config 之外,我已经让它们全部工作,因为该对象不存在于 Assets 或 Scene 下拉列表中。然后我找到了these instructions,它让我能够完成 ARCoreExtensions 的必要字段,并成功构建项目。

    (注:) 我已将整个 ARCore Extensions 包放入 Unity 项目的 Packages 文件夹中,这导致了后来的一些其他问题(与正确的 Window&gt;Package Manager&gt;+ (dropdown)&gt;Add package from disk&gt;package.json 相对)。所以,如果我上面的解释不是实际问题,那么包导入一定是。

    【讨论】:

      【解决方案2】:

      在我的情况下,我需要重新导入示例项目并将位于 cloundanchorexample/configurations 中的配置对象重新连接到我场景中 ARCoreExtensions 对象上的配置槽。

      感谢您为我指明正确的方向!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-11-04
        • 1970-01-01
        • 2020-12-06
        • 2019-05-07
        • 1970-01-01
        • 2020-09-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多