LocalJoost / BlogComments

This repo is solely used for comments on https://localjoost.github.io/
4 stars 0 forks source link

Comments on "Running an MRTK3 app on an Android Phone" #428

Open LocalJoost opened 1 year ago

LocalJoost commented 1 year ago

Original article: https://localjoost.github.io/Running-an-MRTK3-app-on-an-Android-Phone/

timothyt commented 1 year ago

Thanks this was helpful on getting things working again on iOS too. Did take me a little while to figure out that "click Assets/Input Settings" meant on the main menu select "Assets/Create/Input Actions"

LocalJoost commented 1 year ago

@timothyt I am sorry about the confusion. First of all, it should have said "right-click" in stead of click. And the "Assets" prefix should not have been there. Fixed. Thanks for the feedback.

I am happy you got things working on iOS. Please write a blog post of how you went about ;) I don't have a Mac, so I can't try it myself.

ptc-lexvandersluijs commented 11 months ago

Hi Joost!

Thanks for this article, very interesting! Some time ago I was thinking about the feasibility of using a diegetic UI with smartphones (vs only with eyewear XR), and it looks like this project would be a great jumping-off point for such an experiment.

I'm running into an issue though, hope you have an idea about a fix. When I open the project (using Unity 2021.3.10f1 on Windows, so a bit newer than the Unity version used for the repo) I get this error about the RealityCollective service framework package not being resolved.

RealityCollective framework resolution error

So, assuming that perhaps the package has moved, I went to the RealityCollective website and saw this URL for importing the package: https://github.com/realitycollective/com.realitycollective.service-framework.git

When I add the package in Package Manager using that Git URL a good set of versions becomes available. But the version used in the project (1.0.0.preview-7) isn't there.

RealityCollective framework version missing in Package Manager

So I choose the next higher version that works, which is 1.0.1, and that gets loaded, yay!

Except that a single error now remains: Assets\MRTKExtensions\Services\MRTK3ConfigurationFindingServiceProfile.cs(10,79): error CS0246: The type or namespace name 'IServiceDataProvider' could not be found (are you missing a using directive or an assembly reference?)

One hypothesis is that the IServiceDataProvider is actually an interface from Unity and this is caused by that version difference, but that seems like a long shot considering that in Visual Studio this using statement at the top of MRTK3ConfigurationFindingServiceProfile.cs is greyed-out: using RealityCollective.ServiceFramework.Interfaces;

I'm not familiar enough (or rather: at all..) with the Service Framework to troubleshoot this. Do you have an idea for what could be a solution?

LocalJoost commented 11 months ago

I know exactly what the problem is. Unity f*cked up the package chain, which makes the pre release version unavailable. And Just before release, the ServiceFramework authors changed a bit of the API for some reason. I warned them this would break all the samples out in the wild) including mine).

I can't fix this particular problem right now. If you have the patience to wait a bit, I will. If you don't have that patience, have a look at https://localjoost.github.io/HoloLens-AI-using-Yolo-ONNX-models-to-localize-objects-in-3D-space/ that features a service as well, but one implemented after they broke stuff

ptc-lexvandersluijs commented 11 months ago

Ah, that's good to know, and thanks for the link!

I'm not in a huge hurry, won't have time to continue with this until August 1st.

LocalJoost commented 11 months ago

So I am back and finally have some time. I have an MRTK3 version, upgraded to the latest of everything, on Unity 2021.3.23f1 here for you https://github.com/LocalJoost/QRCodeService/tree/MRTK3

ptc-lexvandersluijs commented 10 months ago

Sounds good, thanks Joost!

I'm running into one thing though, and that's that when I switch to Android as the Build Target, I get this error:

BuildFailedException: No valid MRTK Profile for build target platform. Check Project Settings/Mixed Reality Toolkit and apply a valid MRTKProfile to your target platform. Microsoft.MixedReality.Toolkit.Editor.MRTKBuildProcessor.UnityEditor.Build.IPreprocessBuildWithReport.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.microsoft.mrtk.core@66c690c1a686/Editor/MRTKBuildProcessor.cs:66) UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass16_0.b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at <964670f15c6b47f9b8f9340732720473>:0) UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List1[T] oneInterfaces, System.Action1[T] invocationOne, System.Collections.Generic.List1[T] twoInterfaces, System.Action1[T] invocationTwo, System.Boolean exitOnFailure) (at <964670f15c6b47f9b8f9340732720473>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Seems like I need to do a deep dive into the magical world of MRTK to understand how to solve this. Is this obvious for you, or am I asking for too much?

LocalJoost commented 10 months ago

Read line 1-3 carefully. It says exactly what you should do. I am surprised that is necessary though

ptc-lexvandersluijs commented 10 months ago

Right, but I don't know how to set up a valid MRTK profile for Android (hangs head in shame).

LocalJoost commented 10 months ago

I think you should just take the default one ;). If that doesn't ring a bell, please wait, I am having dinner right now. I'll check in half an hour :)

LocalJoost commented 10 months ago

You don't set it up, you just select it. First click the round thingy right, then select the profile. Make sure you do this for every platform you want to use it on. I am currently in the process of upgrading it to newer versions. Keep you posted. Don't have much time tonight. image

LocalJoost commented 10 months ago

I have looked into this a bit deeper, and it's clear I need to update it to newer versions of MRTK3 and Service Framework. Unfortunately that will have to wait until the weekend. I am sorry.

ptc-lexvandersluijs commented 10 months ago

No problem, very happy that you're willing to help out with my wacky experiment.

LocalJoost commented 10 months ago

So I updated the project to the newest version of ServiceFramework. If you now pull the main branch from GitHub (preferably in a fresh folder) it should run without a problem. You should also be able to upgrade to Unity 2021.3 (I used Unity 2020.3.21f1). However, if you then try to update to MRTK3.0.0-Pre17 things go really south. The project doesn't compile anymore. But at least you can play with stuff again

ptc-lexvandersluijs commented 10 months ago

Yes! It's working now :-) I checked the main aspects on my phone: camera background, pose tracking, touch interaction all Ok.

Thanks again! I look forward to experimenting further with it.

LocalJoost commented 10 months ago

As an experiment I upgraded the sample to Unity 2022.2.12 and MRKT3 pre17 and did not get any errors. And it works fine still - with the newest MRTK3! https://github.com/LocalJoost/MRTK3PhoneInteraction/tree/upgrade_mrkt3pre17_unity2022