mapbox / mapbox-unity-sdk

Mapbox Unity SDK - https://www.mapbox.com/unity/
Other
721 stars 214 forks source link

"Mapbox" Menu not appearing after importing package #786

Closed tfine closed 6 years ago

tfine commented 6 years ago

Unity 2018.1.02f Mapbox SDK 1.4.2 macOS 10.13.4

Trying to install the Unity SDK on a Mac, but the menu does not appear after importing. The full asset folder is available.

tfine commented 6 years ago

Ok, it seems the latest version of Unity is not supported (at least on iOS?)? It worked in 2017. You might want to put this in the README if that's the case.

wilhelmberg commented 6 years ago

@tfine SDK should work with all current versions of Unity, I just tried with latest beta 2018.2.0b4.

Do you see any error messages in the console?

tfine commented 6 years ago

Yes, there are three errors on load (two yellow, one red)

YELLOW: Assets/GoogleARCore/SDK/Scripts/Editor/BuildHelper.cs(33,18): warning CS0618: UnityEditor.Build.IPreprocessBuild' is obsolete:Use IPreprocessBuildWithReport instead'

RED: Assets/GoogleARCore/SDK/Scripts/Editor/BuildHelper.cs(33,18): error CS0535: GoogleARCoreInternal.BuildHelper' does not implement interface memberUnityEditor.Build.IPreprocessBuild.OnPreprocessBuild(UnityEditor.BuildTarget, string)'

YELLOW: Metal: Fragment shader missing texture binding at index 0 (_MainTex / Hidden/GUITextureBlit2SRGB)

wilhelmberg commented 6 years ago

RED: Assets/GoogleARCore/SDK/Scripts/Editor/BuildHelper.cs(33,18): error CS0535: GoogleARCoreInternal.BuildHelper' does not implement interface memberUnityEditor.Build.IPreprocessBuild.OnPreprocessBuild(UnityEditor.BuildTarget, string)'

That's why it's not working. A bug in GoogleARCore preventing Unity from compiling files.

Two options:

  1. if you don't need AR support delete these folders:

    • GoogleARCore
    • MapboxAR
    • UnityARInterface
    • UnityARKitPlugin
  2. if you need AR apply this fix to sdkproject/Assets/GoogleARCore/SDK/Scripts/Editor/BuildHelper.cs https://github.com/mapbox/mapbox-unity-sdk/compare/2018-fixes#diff-21e75b07f3ff813cb6f8195f156b5c25

suraj1988 commented 6 years ago

Solution doesent seem too clear. Do these folders need to be deleted from the asset menu? Does the package need to be reimported. Instructions that are a bit less vague would be helpful. Thanks.

abhishektrip commented 6 years ago

@suraj1988 If your application does not need AR - delete the folders mentioned above. No need to reimport the package

If you need AR - do not delete folders and apply the patch linked above.

JalalJaberi commented 6 years ago

I had the same problem and simply (and temporary) changed the BuildHelper.cs code. Let it implements both versions OnPreprocessBuild(BuildReport report) and OnPreprocessBuild(BuildTarget target, string path).

Everything is good now.

aaronmckeehan commented 5 years ago

It appears that this seems to be a problem again. The link to the fix doesn't work any more. Using Unity 2019.1.3f1 on macOS:

Assets/GoogleARCore/SDK/InstantPreview/Scripts/InstantPreviewManager.cs(32,23): error CS0234: The type or namespace name 'SpatialTracking' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

brnkhy commented 5 years ago

@aaronmckeehan Unity 2019 moved some core classes to packages so you're getting that missing class error. If you install ArFoundation package (which now contains those classes), it should fix that error.

aaronmckeehan commented 5 years ago

Thanks! I saw that BuildHelper depended on ARCore. Installing the XR Legacy Input Helpers fixed my issue.

caglisto commented 5 years ago

Installing the XR Legacy Input Helpers from Window > Package Manager fixed my issue too.

sicwence commented 5 years ago

Thanks @caglisto and @aaronmckeehan. Installing the XR Legacy Input Helpers fixed my issue in Unity 2019.1.6f1

Sreee47 commented 3 years ago

I can find the same issue in the new unity 2021 and in Mapbox sdk v2.1.1. I can't find an option to add the XR Legacy Input Helpers. Tried Installing ARFoundation and ARCore XR plugin and reimporting all as found on some forum, but still its not throwing errors and also its not giving me the dialog for mapbox settings to add the API Key.

Sreee47 commented 3 years ago

I can find the same issue in the new unity 2021 and in Mapbox sdk v2.1.1. I can't find an option to add the XR Legacy Input Helpers. Tried Installing ARFoundation and ARCore XR plugin and reimporting all as found on some forum, but still its not throwing errors and also its not giving me the dialog for mapbox settings to add the API Key.

The following is the errors that i have now. Assets\GoogleARCore\SDK\Scripts\ARCoreBackgroundRenderer.cs(43,17): error CS0246: The type or namespace name 'ARBackgroundRenderer' could not be found (are you missing a using directive or an assembly reference?) Assets\UnityARInterface\ARRemote\Scripts\ARRemoteEditorInterface.cs(40,17): error CS0246: The type or namespace name 'ARBackgroundRenderer' could not be found (are you missing a using directive or an assembly reference?) Assets\UnityARInterface\Scripts\ARCoreInterface.cs(51,17): error CS0246: The type or namespace name 'ARBackgroundRenderer' could not be found (are you missing a using directive or an assembly reference?) Assets\UnityARInterface\Scripts\ARKitInterface.cs(26,17): error CS0246: The type or namespace name 'ARBackgroundRenderer' could not be found (are you missing a using directive or an assembly reference?)