Arcore-unity-sdk: ARCore 1.3 introduces breaking changes for building on Unity 2018

Created on 15 Jul 2018  路  6Comments  路  Source: google-ar/arcore-unity-sdk

I believe this issue was originally addressed in #114 for BuildHelper.cs but has now reappeared in recent releases. Unity 2018.1b requires OnPreprocessBuild to be implemented, targeting different unity versions is supported using the new platform dependent compilation. The issues appears in ExamplePreprocessBuild.cs, AugmentedImageDatabasePreprocessBuild.cs, CloudAnchorPreprocessBuild.cs, and RequiredOptionalPreprocessBuild.cs.

Here's the full error log from Unity:

Assets/GoogleARCore/Examples/Common/Scripts/Editor/ExamplePreprocessBuild.cs(29,20): error CS0535: `GoogleARCore.Examples.Common.ExamplePreprocessBuild' does not implement interface member `UnityEditor.Build.IPreprocessBuild.OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport)'

Assets/GoogleARCore/SDK/Scripts/Editor/AugmentedImageDatabasePreprocessBuild.cs(30,18): error CS0535: `GoogleARCoreInternal.AugmentedImageDatabasePreprocessBuild' does not implement interface member `UnityEditor.Build.IPreprocessBuild.OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport)'

Assets/GoogleARCore/SDK/Scripts/Editor/CloudAnchorPreprocessBuild.cs(31,20): error CS0535: `GoogleARCoreInternal.CloudAnchorPreprocessBuild' does not implement interface member `UnityEditor.Build.IPreprocessBuild.OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport)'

Assets/GoogleARCore/SDK/Scripts/Editor/RequiredOptionalPreprocessBuild.cs(29,20): error CS0535: `GoogleARCoreInternal.RequiredOptionalPreprocessBuild' does not implement interface member `UnityEditor.Build.IPreprocessBuild.OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport)'

The following snippet from googlevr/gvr-unity-sdk#861 introduces a fix:

``` C#

if UNITY_2018_1_OR_NEWER

public void OnPreprocessBuild(BuildReport report) {
OnPreprocessBuild(report.summary.platform, report.summary.outputPath);
}

endif

```

Additionally have to add the using directive using UnityEditor.Build.Reporting; as this is where BuildReport resdes.

If any lost souls stumble upon this and need a quick fix I've forked it and patched it in here :)

Most helpful comment

Unity 2018.2.0f2 has unfortunately the same problem.

All 6 comments

Hi, thanks for the report. What exact version of Unity are you using? I think this should only be warning with the last update of 2018.1.

I'm on 2018.1.0b4, will try upgrading to see if this resolves the issue!

Unity 2018.2.0f2 has unfortunately the same problem.

Hi, I believe latest versions of 2018.1 have no issues with this. The 2018.2 issue is being tracked in #197. Feel free to comment if you still have issues with 2018.1.

This is not resolved as i am also getting the same error with Unity
image

Unity version is 2018.2.2f1. I really need to get this to work. I am following the exact steps as given in the ARCore Unity quick start.

Rigurosally following step step on an old tested win10 enviroment, I must say thanks for the effort to the AR team, but it is not working. Plenty of error messages at building, til I gave it with the fixes.. ended up with "just" 2, driving me crazy! on unity 2018.2.16f1

  1. Building application with REQUIRED ARCore support.
    UnityEngine.Debug:LogFormat(String, Object[])
    GoogleARCoreInternal.RequiredOptionalPreprocessBuild:OnPreprocessBuild(BuildTarget, String) (at Assets/GoogleARCore/SDK/Scripts/Editor/RequiredOptionalPreprocessBuild.cs:35)
    GoogleARCoreInternal.PreprocessBuildBase:OnPreprocessBuild(BuildReport) (at Assets/GoogleARCore/SDK/Scripts/Editor/PreprocessBuildBase.cs:52)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

  2. A cloud anchor API key has not been set. Cloud anchors are disabled in this build.
    UnityEngine.Debug:Log(Object)
    GoogleARCoreInternal.CloudAnchorPreprocessBuild:_PreprocessAndroidBuild() (at Assets/GoogleARCore/SDK/Scripts/Editor/CloudAnchorPreprocessBuild.cs:140)
    GoogleARCoreInternal.CloudAnchorPreprocessBuild:OnPreprocessBuild(BuildTarget, String) (at Assets/GoogleARCore/SDK/Scripts/Editor/CloudAnchorPreprocessBuild.cs:41)
    GoogleARCoreInternal.PreprocessBuildBase:OnPreprocessBuild(BuildReport) (at Assets/GoogleARCore/SDK/Scripts/Editor/PreprocessBuildBase.cs:52)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Was this page helpful?
0 / 5 - 0 ratings