mapbox-unity-sdk icon indicating copy to clipboard operation
mapbox-unity-sdk copied to clipboard

Import error: The name 'heading' does not exist in The current context

Open yuqianma opened this issue 5 years ago • 1 comments

Note: If this is a bug or support ticket, please provide the following information:

  • Unity version: 2019.3.5f1
    • Scripting Runtime Version:
    • Scripting Backend:
    • Api Compatibility Level:
  • Mapbox SDK version: v2.1.1
  • The platform you're building to:
  • A description of what you're trying to do:
  • Steps to recreate the bug if appropriate:
  • Links to your logs are also helpful:

I'm trying to import the sdk, but cannot find the "Mapbox" menu. (There're other errors related to AR packges. I can only import the SDK after all AR stuffs are removed.) There's an error in console: Assets\Mapbox\Unity\Location\DeviceLocationProvider.cs(321,12): error CS0103: The name 'heading' does not exist in the current context

Though I am using v2019, this bug can be seen back to v2018: https://forum.unity.com/threads/mapbox-import-problem.639760/

The solution above is to uncomment the line. However it is strange since it is a SDK. Finally I find out the problem. It is an encoding issue. You can check the raw file origin: https://raw.githubusercontent.com/yuqianma/mapbox-unity-sdk/ab56a8ccd8a6456a71bbcd848c720add62c3bd7b/sdkproject/Assets/Mapbox/Unity/Location/DeviceLocationProvider.cs

revised: https://raw.githubusercontent.com/yuqianma/mapbox-unity-sdk/2cd90ae9158d8ca426278a0e786811dfcfabc6b0/sdkproject/Assets/Mapbox/Unity/Location/DeviceLocationProvider.cs

Note the ° sign around double heading. The original file's code set is ISO-8859 text. While others are UTF-8 or ASCII. Don't know why here.

I fire this issue to log the problem. Please review the pull request.

yuqianma avatar Mar 17 '20 09:03 yuqianma

This is helpful ! Thank you ^U^

kuan0426 avatar Mar 19 '20 06:03 kuan0426