New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HoloLens and MapBox issue #734
Comments
@nosmirck have you set your Mapbox access token?
Also, have you set the |
Yes, it works fine on the Unity Editor. I did it during the step Setup Mapbox. from above
Yes, during the step Apply all 3 options in Mixed Reality Toolkit > Configure. from above. I re-checked the permissions on the VS project, this is what I see: |
@nosmirck thanks for you detailed feedback. I'm getting a
|
@BergWerkGIS great! no problem! For now, I've been working on the rest of the simulation using a map I saved in runtime with the editor (made the map object once loaded a fbx) and I'm cool with that for now. Just to share a bit what I'm doing: I'm rendering a real time map on top of a table using HoloLens. On top of the map some data will be visualized by converting the data into a heat map texture and projected on top of the MapBox based on the location. So, in the next few weeks I'll be working with all the rest of the project with a mocked map. There's no hurry, I have exactly 4 weeks from tomorrow to finish this project (it's actually a PoC) and I'd love to include the ability to zoom the map and change location. Thanks for the support! |
Hey @nosmirck , were you able to setup project with Hololens and MapBox? |
@YouAlwaysLoose no, I finished the rest of my PoC using a mocked map that I saved in editor runtime using this handy tool https://github.com/pharan/Unity-MeshSaver/blob/master/MeshSaver/Editor/MeshSaverEditor.cs For the purpose of my PoC I believe I have enough, I'd like to have MapBox really load the current location and render the map properly so I can zoom in/out, change locations, etc. I'm still waiting for this bug to be fixed though. @BergWerkGIS is there any ETA for this? |
Working on it, but no ETA yet. |
@nosmirck Thank you for the quick reply. |
@Storm-Develop thanks, your help is very much appreciated 😄 |
@BergWerkGIS =) Sorry I am not that familiar with MapBox structure yet to help more. I am just trying first to make it work with the simplest solution possible. If I downgrade Unity to version 2017.1 is that going to help? @nosmirck when you referred that map didn't render what exactly you meant? Did you see a map in HoloLens? I can't see anything except skybox. |
Exactly, the map doesn't render in the HoloLens (simulator and device) and I get the error I reported above (This is the console output) which seems to be related to the JsonSerializer @BergWerkGIS is talking about |
The problem is that Unity and HoloLens (UWP - Universal Windows Platform) are running on different .Net framework versions which offer a different set of APIs. Because of the different APIs execution flow through code may follow different paths depending on the framework that's being used. Take this simple example of string comparison: mapbox-unity-sdk/sdkproject/Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Response.cs Lines 273 to 279 in 803b329
And we have a lot of those Previously
Unfortunately I cannot tell: Unity's behavior has changed in one of the 2017.x releases but I don't know which as I haven't tried each and everyone. |
@BergWerkGIS I see now, thank you for the detailed answer. |
@Storm-Develop I really can't tell as I'm hitting a Open to suggestions how to get past that! .NET framework version used by #if UNITY_WSA
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public class DescriptionAttribute : Attribute {
private readonly string description;
public string Description { get { return description; } }
public DescriptionAttribute(string description) {
this.description = description;
}
}
#endif That produces the following
as the API of the .NET framework version used by Editor does have the So we wrap our definition into However when I try to build to I get
as we are still in Editor and ❓ ❓ ❓ My setup: |
@BergWerkGIS I see what if we just comment the description text for now? |
Thanks for the ideas but I've already tried those and others ( Always the same problem: during different stages of the export Unity seems seems to use the Mono compiler and then for some other C# files the Microsoft compiler. Also tried different runtimes and settings for the .NET Core override:
Yes, I had the same idea 😄 and that got me past the first hurdle. Now working on module I'll keep this ticket updated. |
@BergWerkGIS Millions of Thanks! It does work! Just a small comment I didn't have SQLite for UWP so downloaded from the market place https://marketplace.visualstudio.com/items?itemName=SQLiteDevelopmentTeam.SQLiteforUniversalWindowsPlatform |
@Storm-Develop Great! 🎉 🎆 Thanks for testing 🙏 Be aware though that this is still work in progress and might need a few more weeks till it gets into
Oh yeah, thanks for the reminder. I forgot to mention that. |
I have tried the same settings as you mentioned above in my own project and in an empty project and got the same atttribute errors in Unity 2018.1.6. Is there a possibillity for my to clone the Hololens-fixes? Last time I tried to clone the branch with above command, but that it wasn't working before I wrote issue #875 |
@timgoeij Based on your error image you didn't get the hololens-fixes branch. Just download the branch hololens-fixes manually as zip file. |
@timgoeij I agree with @Storm-Develop: looks like you didn't get the Either use this
or download https://github.com/mapbox/mapbox-unity-sdk/archive/hololens-fixes.zip For both options make sure you are using a new target directory and not save/clone into an existing (SDK) one, which might also lead to those errors. |
@BergWerkGIS You are amazing. Thanks for great help . I am able to run all the samples of mapbox. Thanks a ton.! Just need to know how you people record hololens screen? |
Thanks @mayank-technical 🙏
By hitting |
Thanks a lot William.!! :)
…On Mon 9 Jul, 2018, 5:31 PM Wilhelm Berg, ***@***.***> wrote:
Thanks @mayank-technical <https://github.com/mayank-technical> 🙏
Just need to know how you people record hololens screen?
By hitting Record in the Device Portal 😄:
https://docs.microsoft.com/en-us/windows/mixed-reality/using-the-windows-device-portal#mixed-reality-capture
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#734 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFbM3OpwyzkDoAa_mDrEdM522jyeOAkTks5uE0YbgaJpZM4TzDV_>
.
|
Is there any update on when this will be rolled up? Creating a cross platform app for mobile and hololens using World Scale AR. Thanks! |
@emartinDesignInteractive PR is up #945 but not yet merged. |
@BergWerkGIS hey, thanks for the work that you have been doing but do you know how long it will be for the mapbox to work with unity's il2cpp compiler? |
Closing - PR #945 UWP fixes (and more) was merged. NOTE: |
Hi, I was wondering if this is still an ongoing issue. I am attempting to use mapbox on hololens and have tried everything in this thread and I still get this error:
Any help would be appreciated! |
Hi, I was trying the same and after digging for a few hours... i found that the problem is that the PRAGMA command send to the sqlite was actually returning a row, and because it get executed with ExecuteNonQuery command it was not expecting a row results, what cause raise the error. I was able to pass that by chaging the line 2152 of the \Assets\Mapbox\Core\mapbox-sdk-cs\Platform\SQLite\SQLite.cs file as |
You have to substitute unityWebRequests with normal c# HttpRequests, at least that's what I've done elsewhere and it's worked to get Web information. |
Hooo that make sense. Thank you very much. |
@BergWerkGIS Thanks for your work on this; any update on IL2CPP, or is Mapbox still not usable for UWP? |
UNITY 2019.4.31f with MAPBOX v2.1.1 SDK, still the same errors, cannot build for UWP with I2LCPP (mandated by UNITY): "Assets\Mapbox\Core\mapbox-sdk-cs\MapMatching\MapMatchingParameters.cs(15,4): error CS0104: 'Description' is an ambiguous reference between 'Mapbox.VectorTile.Geometry.DescriptionAttribute' and 'System.ComponentModel.DescriptionAttribute'" Any one has taken an effort to fix it or a WorkAround for now ? |
Would recommend looking into Microsoft's Maps for Unity plugin, depending on your use case. |
Hello everyone,
I have also deleted all AR related directories from the mapbox package and set all "Description" occurrences to refer to System.ComponentModel. In MapboxAccountsUnity.dll, I have checked the WSAPlayer checkbox in the inspector panel. Finally, after building for UWP as shown in the picture below, I have added the SQLite reference. I have the same problem as @nosmirck described in #734 (comment), meaning I can successfully deploy to Hololens but on Debug mode I get similar logs as shown here: Most important error in the logs is: Rethrow as JsonSerializationException: Error setting value to 'AccessToken' on 'Mapbox.Unity.MapboxConfiguration'. but the token I provide in the editor is valid. In the Project settings my Scripting backend in IL2CPP which I cannot change but the API compatibility level is .NET 4.x. Does anyone know how I can manage rendering the map on Hololens and resolving the NullReferenceException? Thank you! |
For Hololens-2 and Mapbox in Unity UWP, try this repo ; |
The link is NOT working for me |
I fixed the link sorry 👍 |
Render the prefab "CitySimulatorMap" inside the Mixed Reality experience with HoloLens Device/Simulator.
At this point, everything will work in the Editor.
Trying to compile with above settings will give errors of duplicated/ambiguous use of Description Attribute.
Applying what was described in Removing duplicate definitions of DescriptionAttribute #485 by @BergWerkGIS will allow me to compile the project for VS
Issue:
Map is not rendered.
Here is the Console Output from Compilation to Deploy and Debug the App.
The text was updated successfully, but these errors were encountered: