HoloLens2 Application made with unity throws Exception "Could not create a device for ''Hand - Right (XRInputV1)" - unity3d

Since I updated my HoloLens2 Unity Project to Unity 2020.3 my deployed HoloLens2-Application (in Unity Editor they never happen) always throws the following Exceptions :
Could not create a device for 'Hand - Right (XRInputV1)'
(Exception: System.ArgumentException: Expected control positionAccuracy to be of type 'AxisControl' but is of type 'IntegerControl' instead;)
at UnityEngine.InputSystem.InputControll
Could not create a device for 'Hand - Left (XRInputV1)'
(Exception: System.ArgumentException: Expected control positionAccuracy to be of type 'AxisControl' but is of type 'IntegerControl' instead;)
at UnityEngine.InputSystem.InputControll
Does anybody know, how to get rid of those Exceptions?
I am using the MixedRealityToolkit 2.7.3 HoloLens2 default Configuration and noticed this problem at Unity Versions 2020.3.8, 2020.3.22 and 2020.3.26.

Firstly, please double check the MRTK Input profile setting. You can easily configure the project in Unity Menu: Mixed Reality > Toolkit > Utilities > Configure Project for MRTK
Then, please check out your XR setting, Since you are using Unity 2020.x, you can use OpenXR plugin, see Choosing an XR configuration.
If the issue is still there, this may also be caused by your hand control code. Here is discussion with the same exception as yours, see WikkidEdd's reply in this github issue. In their case, they need to use IntegerControl instead of AxisControl.

OK I fixed the Error-Problem by updating to OpenXR plugin. It fixed basically every problem I had so far within my project. By coincidence I came across the plugin as a tarball file while downloading this sample-project from Github.
I´d wish to find a place where I can get all the plugins which can be installed via Microsoft FeatureTool on one place as manual download! Maybe someday it will exist. :)

Related

Unity Ads with Mediation causes Android builds to fail

When I install "Advertisement with Mediation (ver. 1.5.0)" in a project, I can no longer build for Android.
This applies to new, empty projects as well as legacy projects.
The following error message appears:
“…It looks like there are a few files missing from Assets\Plugins\Android. You can fix this by resolving dependencies again…”
When I click Resolve, the build process starts right away and hangs. I have to force quit Unity. If I don’t click Resolve, the build hangs up on building the first scene in the project and I have to force quit.
Nothing at all happens via Assets -> Mobile Dependency Resolver -> Android Resolver -> Force Resolver.
I am using Unity 2021.3.13.
Does anyone know what is occurring and how to fix it?
I attempted to resolve as stated in the pop up and it causes Unity to hang. I attempted to resolve beforehand and it appears to do nothing.
I attempted to delete my library folder and it had no effect on reimport.
I attempted to export the project, and the project hangs.
I have a similar issue with both Unity Ads with Mediation and the newer Ironsource Ads Mediation(com.unity.services.levelplay). When I run Assets -> Mobile Dependency Resolver -> Android Resolver -> Resolve I get the following error on the console:
Win32Exception: ApplicationName='C:\Users\D\Documents\app\Test\Temp\PlayServicesResolverGradle\gradlew.bat', CommandLine='--daemon -b "C:\Users\D\Documents\app\Test\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" "-PANDROID_HOME=C:/Program Files/Unity/Hub/Editor/2021.3.14f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK" "-PTARGET_DIR=C:\Users\D\Documents\app\Test\Assets\Plugins\Android" "-PMAVEN_REPOS=https://android-sdk.is.com/;https://maven.google.com/" "-PPACKAGES_TO_COPY=com.ironsource.sdk:mediationsdk:7.2.5;com.google.android.gms:play-services-ads-identifier:17.0.0;com.google.android.gms:play-services-basement:17.2.1" "-PUSE_JETIFIER=0" "-PDATA_BINDING_VERSION=4.0.1"', CurrentDirectory='C:\Users\D\Documents\app\Test\Temp\PlayServicesResolverGradle', Native error= The system cannot find the file specified.
The file gradlew.bat doesn't exist. I found a gradlew.bat here: https://github.com/googlesamples/unity-jar-resolver. I copied the file into: C:\Users\D\Documents\app\Test\Temp\PlayServicesResolverGradle and then I could run the the resolver from Unity.
But it leads to this questions: Why does Unity MobileDependencyResolver not create gradlew.bat? It does create gradlew, the gradle start up script for Unix. Why the Unix script and not the Windows script?
Advertisement with Mediation is not being properly supported by Unity anymore post IronSource merger. They suggest using Ironsource’s mediation platform. We use AdMob given I already know how to deal with its obvious bugs.

The type or namespace name 'UniRx' could not be found on Unity

I pretty much looked everywhere... but couldn't find anything that could debug my problem.
The only thing I do in a script is "using UniRx" to have the following error : The type or namespace name 'UniRx' could not be found.
What i tried:
On Unity, downloading from Package Manager with "Add Package with git URL"
On Unity, downloading from Package Manager with the normal way: Download -> import (into folder Plugins)
On each part, i also tried:
"Reimport All"
Closing and opening back Unity Hub then Unity
I found nothing much on google except for having this problem only on Visual Studio (which is not my actually problem since Unity itself doesn't accept UniRx)
But those who have that problem, i read that you need to "Assets" -> "Open C# Project"
Can anyone help me with my problem on Unity ? Searched for hours but still stuck :(
Unity Version: 2021.3.3f1
Well seems like my problem was like fafase said... I totally forgot about assemblies since i don't use Unity much and since it's been a long time i didn't continue my project.

Unity3d with Xbox Live & Mixer Interactive Plugin

I'm using Unity3d 5.6.0f3 and develop a game which uses the Xbox Live Creators Plugin and the Mixer-Interactive-Plugin.
My problem is that both uses the Newtonsoft.Json.dll in different versions, so I got the error message:
error CS1703: An assembly 'Newtonsoft.Json' with the same identity has
already been imported. Consider removing one of the references
Assets/Xbox Live/Libs/Unity/Newtonsoft.Json.dll (Location of the
symbol related to previous error)
Assets/MixerInteractive/Source/DLLs/Win32/Newtonsoft.Json.dll
(Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
Removing one of these assemblies gives an DirectoryNotFoundException in addition, but the previous mentioned error message still exists.
Is there any way to manage references or does anyone know how to fix this?
It was too easy ...
Because the Mixer Interactive Plugin is open source and no pre-compiled assembly with static dependencies, it was possible to just untick all Newtonsoft.Json-references at the import process to unity.
Thank for bringing this up. The quickest way to fix it is to delete Newtonsoft.Json.dll from one of the two plugins. Deleting it from the Xbox Live plugin is simpler (since the plugin has fewer platform checkboxes checked).
We'll see what we can do to make this better.

DllNotFoundException: libgfxunity3d

I'm new to unity and I am trying to use a plugin named Scaleform and I'm following the steps indicated in readme file, I've created a new project, imported the plugin, selected Main Camera object and attached the specified script to it, but when I want to play, I get this error:
DllNotFoundException: libgfxunity3d
SFCamera.OnDestroy () (at Assets/Plugins/SF/SFCamera.cs:163)
I googled and all I got was this: http://forums.autodesk.com/t5/Scaleform-Unity-Development/dll-not-found-exception/td-p/4242779
I've downloaded and installed DirectX too, but still no change! :(
Does anyone know what should I do?
Thanks!
We also ran into this problem on Windows. Ultimately, reinstalling the DirectX runtime did fix it for us (the person who had the problem was missing the d3dx9_43.dll that the Scaleform dll depends on).
You might also check and make sure you have put the right key into the appropriate location in your inherited camera script. (In the example, I believe it is called MyCamera.cs.)
Finally, you should check that your build target matches the version of the Scaleform trial you have installed. If your Unity build setting is Android, for example, you need to have the Android runtime for Windows, not the Windows runtime proper.
I downloaded the Depends application from http://www.dependencywalker.com/ and loaded libgfxunity3d.dll. I was missing msvcr100.dll, IEShims.dll and wer.dll. I threw those dlls into the System32 directory and my program ran great. Hope this helps!

Eclipse #ifdef error using JNI, Android NDK and Vuforia

With Vuforia's ImageTargets sample application, I tried using OpenGL ES 1.1 by setting USE_OPENGL_ES_1_1 to true in jni/Android.mk and uncommenting and changing the corresponding line in AndroidManifest.xml (). After converting the project so that it has a C++ perspective and associating ndk-build and the proper include directories, I could successfully run the application on my Android device.
However, the problem is that once I open up jni/ImageTargets.cpp, I get several errors from Eclipse, all from places where OpenGL ES 2.0 code would execute, the first one being:
Description Resource Path Location Type Symbol 'vertexHandle' could
not be resolved ImageTargets.cpp /ImageTargets/jni line 402 Semantic
Error
Sure enough, vertexHandle is defined at the top of the ImageTargets.cpp, inside the "#ifdef USE_OPENGL_ES_2_0" block. Because USE_OPENGL_ES_2_0 is not defined (per Android.mk), the code should be able to compile successfully, and sure enough, ndk-build does not report any problems. So it seems that only Eclipse reports the problems and when I run the project, Eclipse says, "Your project contains error(s), please fix them before running your application." And thus, I cannot run my application anymore. In a sense, it's kind of strange that this never occurred until I opened ImageTargets.cpp and Eclipse "discovered" the errors.
The best work-around I've found so far is to just delete or comment out those lines (that should not be causing problems because USE_OPENGL_ES_2_0 is not supposed to be defined)... Is there a better way to deal with this problem? Did I miss a setting in Eclipse that should solve this?
I've found a solution: go to the project properties -> C/C++ Build -> Discovery Options -> Check "Automate discovery of paths and symbols"