MRTK V2.2 - Cant build because of error while creating certification - unity3d

I updated to Mrtk from 2.1 to 2.2 and Unity from 2019.2.15 to 2019.3. In play-mode everything works fine but my build is failing because of following lines:
#1
Failed to create a file 'MRTK v2.0\QViewer Mrtk 2.2\Assets\WSATestCertificate.pfx'
UnityEditor.EditorUtility:WSACreateTestCertificate(String, String, String, Boolean)
#2
Error while creating certificate at 'MRTK v2.0\QViewer Mrtk 2.2\Assets\WSATestCertificate.pfx'
UnityEditor.EditorUtility:WSACreateTestCertificate(String, String, String, Boolean)
#3
InvalidOperationException: Failed to create test certificate.
PostProcessWinRT.CreateTestCertificate () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1045)
I tried to delete my old WSATestCertificate.pfx and switched my build folder, but that didnt help. Is sb else experiencing the same behaviour?
--Edit--
Link to issue on github.

I somehow "fixed" the problem, by downgrading Unity back to 2019.2.15 and updating again to 2019.3. Or by resetting my build and project settings in unity. The only part that does not look good are the 147 Warnings about obsolete api...but my building works now and the app runs!

Related

What causes Hololens v1 build error "Handedness is an ambiguous reference"? [duplicate]

I try to build my Hololens 2 application but i get errors which i can not solve.
When I try to test the application with the Unity play button, it works as expected. I have also tried the MRTK sample scene, which also works only through the play button, but does not when I try to build it.
Build Errors:
Library\PackageCache\com.microsoft.mixedreality.toolkit.foundation#251fc689f36f\Providers\WindowsMixedReality\XRSDK\WindowsMixedRealityDeviceManager.cs(404,128): error CS0104: 'Handedness' is an ambiguous reference between 'Microsoft.MixedReality.Input.Handedness' and 'Microsoft.MixedReality.Toolkit.Utilities.Handedness'
Error building Player because scripts had compiler errors
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <1135c66e5f4c41a7831fa5798849d8b6>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <1135c66e5f4c41a7831fa5798849d8b6>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
I tried to update the MRTK with the MixedRealityFeatureTool and did the Mixed Reality Toolkit-Set Up as described in the tutorial. But i still get the errors, which means i can not test it on the Hololens 2.
Also happening for me and only happened when upgraded to MRTK 2.8.
As we are developing for HoloLens, there is no need for the MixedReality.Input package, which is causing the conflict. Simply remove that from the Package Manager.
I had this problem but I was able to fix the error by going to the script in the specified path (Library\PackageCache\com.microsoft.mixedreality.toolkit.foundation#251fc689f36f\Providers\WindowsMixedReality\XRSDK\WindowsMixedRealityDeviceManager.cs) in the error, going into the error line (404) and changing Handedness to 'Microsoft.MixedReality.Toolkit.Utilities.Handedness'

Fatal Crash when using Unity to call startMoniting from AAR file

I use the android-beacon-library-2.17.1.aar to make an Android App and detect the ibeacon's major/minor numbers. When I call beaconManager.startMonitoring(new Region("myMonitoringUniqueId", null, null, null)); the App runs well. And I make the program I design to the classes.jar file.
Now I use Unity and try to use this jar file to detect the ibeacon on my Unity Android Application. I put the classes.jar and AndroidManifest.xml in to my Unity project and try to call the beaconManager.startMonitoring(new Region("myMonitoringUniqueId", null, null, null)); the compile and Build are passed, but when I install the apk on my phone and run it, the application crash.
The Phone I use: Zenfone 7 -- Android 11
The version of Unity: Unity2019.4.31f1
The error log:
java.lang.NoSuchMethodError: No virtual method startRangingBeacons(Lorg/altbeacon/beacon/Region;)V in class Lorg/altbeacon/beacon/BeaconManager; or its super classes (declaration of 'org.altbeacon.beacon.BeaconManager' appears in /data/app/~~lOm13WWD8uZ_nbS2pIVb3A==/com.example.aartesting-LqhAFNQZtBYPkoICvZt1ig==/base.apk)
It's sorry that my English is not very well, and I afraid that I can't describe my problem clearly. If you want to know more about my problem, please let me know, I will try to make you know more about the situation I met.
Thank you!
I suspect the problem is caused by R8 or ProGuard settings, which obfuscate code to prevent reverse engineering. Aggressive R8 or ProGuard settings will rename certain classes and methods (including library class methods like startRangingBeacons mentioned in the stack trace).
You can read more about how R8 and ProGuard work here: https://developer.android.com/studio/build/shrink-code
To confirm this is the problem, you should edit your project settings for Android to disable R8 and ProGuard. Doing so for a native Android project is as simple as editing the build.gradle file and setting minifyEnabled false. Since I am not a Unity expert, I cannot tell you how to do the same thing from Unity.

FB.Init() error during gradle build unity

I am using Unity 2018.1.6f1 and facebook-unity-sdk-7.13.0. When I try to build the project using gradle, the build is completed successfully but it gives an error while calling FB.Init()
"AndroidJavaException: java.lang.ClassNotFoundException:
com.facebook.unity.FB".
I tried the solution in the following links:
Android ProGuard settings for Facebook
I even checked whether I was using debug keyhash, which I was, but I addded release key hash and still getting the same error.
Any help would be appreciated.
P.S. It works fine in debug build
On Android publishing settings section (in the place you set the keystore stuff), there is a checkbox for User ProGuard file (at least if you are on Gradle). If you check it, Unity will make such file and put it in the project.
Then, on the proguard file, I added:
-keep class com.facebook.** { *; }
-keepattributes Signature
And that seems to be all!
Then I see the FB SDK initing properly both on Debug and Release:
Hope it works for you as well.

libgdx can't start desktop project on ubuntu

so, I just created libgdx project for desktop and imported it (gradle) to eclipse. When I launch it this error pops up:
Exception in thread "LWJGL Application" java.lang.ExceptionInInitializerError
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setVSync(LwjglGraphics.java:446)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:118)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:954)
at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:738)
at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
... 2 more
AL lib: (EE) alc_cleanup: 1 device not closed
I can't figure out what's happening. Project's created for android and launched in android studio working properly.
You need to install the xorg-xrandr package, see
http://badlogicgames.com/forum/viewtopic.php?f=11&t=18801
This is a known issue, try to install xorg-xrandr.
Also, I fixed this issue by installing bumblebee.
This error disappeared for me after I switched from the default lwjgl backend (that is for some reason still used in the tool to generate a LibGDX project) to lwjgl3 backend. This is how you do it for a project freshly generated with gdx-setup.jar (doc):
In build.gradle change
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
to
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
In DesktopLauncher class, change
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new Game(), config);
to
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
new Lwjgl3Application(new Game(), config);
and modify imports to
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
so basically just add 3 after lwjgl in those two places.

Could not securely load assembly (Unity 4.5.1 + Facebook Unity SDK 5.1)

I've just updated Unity from 4.3.4 to 4.5.1 and got this error with Facebook Unity SDK 5.1:
Could not securely load assembly from https://integrated-plugin-canvas-rsrc.fbsbx.com/rsrc/unity/lib/sdk_5.1/CanvasFacebook.dll
I tried the fix explained in Unable to verify assembly data; you must provide an authorization key when loading this assembly but was unable to comment (not enough reputaion) so had to ask a new question.
string key = "B8GvecdX0rQ47kzhCEwlrRzYKA8LKeiZxy1HI3HfnhdgUATvBwQQViji8ot44dADM55QuHk5+hwrLso" +
"au32IDmRDQTclMSsTsIywGRo/nE5vbmRMMIECYXBFhliz+kvK0RWZ57XPxw0s7YhGnNLav0EE2QH/m+9a" +
"jlLOY+2ckxSoSEHLpotllyZLktRK+oFiDPvmzXLDUMOnwK9RFRSh2VBmoyWTZx8BYqWjqug3kAljJk/Xw" +
"TYZT9Ie+HvzLO5DBSqMNYbEX03WaNfpaq9GKBF/Oz37AHelf1Es36amP1v2Aut3nmIk2xxN6zwzBXyEyw" +
"90vJ/O8suikU+8kDDbZA==";
var assembly = Security.LoadAndVerifyAssembly(www.bytes, key);
Note that I added the fix code into the UNITY_4_5 section.
Is the key now wrong as it was given back in March?
I should note that I only see this error in one project. I have another project that also uses the Facebook Unity SDK but I don't see the error in that one.
UPDATE:
As of Monday 30 June the original issue seems to have been resolved. There's now no problem loading the assembly via the original code.
UPDATE 2:
Actually I've seen the secure load fail a few times since, but not always.