Building Unity3d Project reloads SteamVR plugin - unity3d

I'm Building my Unity project with a custom script.
The crucial line is the following
BuildPipeline.BuildPlayer(new string[] {}, path + filename + ".exe",
BuildTarget.StandaloneWindows,
BuildOptions.None);
If I execute this, Unity will reload the Scene in a way that the SteamVR plugin is reinitialized.
Effectively this Plugin asks me to accept some settings with a dialog every time I build the project.
When I build the Project using the standart Build and Run option (ctrl+B) this does not happen.
Is there a way to prevent this reloading from happening with the BuildPipeline ?

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.

Remove Wave XR permissions from AndroidManifest in Unity

I am building onto both Vive and Oculus platforms in my Unity project. I need the VIVE Wave XR plugin in my packages to build to Vive. However, this means when I build to Oculus, I have Vive permissions in the AndroidManifest within my APK so I am blocked from uploading it by Oculus. What is the best way to remove them?
Tried solutions:
I can use Android Studio to 'Analyze APK...' then edit it manually but this is not suitable for me as I need the process to be automated.
I can use a pre and post build processor to remove and then replace the offending file from the Vive package so that when Gradle merges all of the manifests it will not detect the Vive one. This sort of works but is rather hacky and the post-processor doesn't run if the build fails, leaving the offending file in the incorrect location.
I have looked into using a 'Custom Main Manifest' in (Project Settings -> Player -> Publishing Settings -> Build) but this only seems to add to the final manifest rather than remove from. There are other options to change Gradle templates in the Publishing Settings but I don't understand how to use them. Would any of those be helpful?
I found the solution here: https://developer.android.com/studio/build/manage-manifests
Specifically this section

Unity building old version of the game

I am trying to build my game, but unity is building old version instead, what can I do? My unity version is 2021.3.7f1, targeting WebGL. All scenes are added in the Build and there are no build errors
Here are the cases that I have tried:
Running the game via Build and Run works
All Scenes are added in the Build
No errors before and after building
I noticed that after a new build, the only changes that
occurred are in the ProjectSettings.asset file and the index.html
file
I was stuck with same error for hours!
Everything looks fine in editor, updated version of the scene, but in build without any errors a very old version is being generated.
What I tried (that did NOT work, but that has been recommended and could work):
Deleting Library and obj folder
Using different version of Unity
Testing WebGL build instead of Win build
Selecting "Clean Build" instead of "Build and run"
Duplicating scene, adding and removing it from "Scenes in Build" list
Restarting Unity/computer
What finally DID work:
I copy all content of scene and pasted it in a new scene. This worked right away, but some models/materials were missing. So I am assuming that those materials and models were silently causing some problem so I replaced them and scene was built properly once again.
Very mysterious issue!
Hope this helps!

Reload Scripts Assemblies (busy for long time) Unity Freezes

I'm Using Unity version 2020.3.32f1 & Rider as Editor. Whenever I make any changes in scripts, even small changes, Unity script assemblies take too much of time to compile and load. Sometimes it freezes Unity entirely and in the Task Manager I can see "application not responding" for the Unity session.
Does anyone know how I can solve this issue?
Disable Domain Reloading. To disable Domain Reloading:
Go to Edit > Project Settings > Editor
Make sure Enter Play Mode Options is enabled.
Disable Reload Domain
source https://docs.unity3d.com/Manual/DomainReloading.html
Edit > Project Settings > Editor > Check Enter Play Mode Options
Uncheck reload domain & reload scene
That worked for me .. unity 2021.3.4f1
After so much of research, I got one solution which worked for me , in Unity Package manager , Search for Rider & got Update for rider. After Updating Rider version from unity package manager. my Scripts reloading issue got fixed.
The Windows version of UnityEditor also has this problem.
Weirdly, if you have this problem, just save any file in your Unity project folder without changing anything and the progress bar will start progressing.
Open Window->Package Manager. Select Packages: In Project to see the packages currently installed. Remove everything you are not using.
Not being logged in in the Unity editor (upper left corner) certainly seems to increase the chances of this issue happening.
If you open the Package Manager without being logged in you get some errors in the console. I suspect this is related but in the script reload case it just hangs.

Setting up libgdx in IntelliJ Idea with GWT Support?

So far the documentation doesn't include the set up of GWT project in IDEA, and my limited google skill can't find the solution. Is it possible?
If you generated your libgdx project using the gdx-setup.jar file, then you should import your project by using the following link: https://github.com/libgdx/libgdx/wiki/Gradle-and-Intellij-IDEA
HTML: View -> Tool Window -> Terminal, in the terminal, make sure you are in the root folder of your project. Then execute gradlew.bat html:superDev (Windows) or ./gradlew html:superDev (Linux, Mac OS X). This will take a while, as your Java code is compiled to Javascript.
Once you see the message The code server is ready, fire up your browser and go to http://localhost:8080/html. This is your app running in the browser! When you change any of your Java code or assets, just click the SuperDev refresh button while you are on the site and the server will recompile your code and reload the page! To kill the process, simply press CTRL + C in the terminal window.
Once this bug in the Gradle tooling API is fixed, we can simplify running the HTML5 by using the Gradle integration. At the moment, the Gradle process will run forever even if canceled.
Also just a heads up, after you have run the gradle command it might say something like this:
The code server is ready.
Next, visit: http://localhost:9876/
Building 91% > :html:superDev
Even though it says 91%, don't worry it will still work, just go here to run it: http://localhost:8080/html/, NOT the url mentioned in the log.
Also to deploy you need to run ./gradlew html:dist to generate production code, you want to copy everything inside ./html/build/dist/ to your server. Running that command produces the code in that directory. https://gamedev.stackexchange.com/a/82588/54396
I was able to make GWT work with libgdx simply by:
downloading (http://www.gwtproject.org/download.html) the GWT SDK,
extracting it,
then in the project structure -> project-name-html -> dependencies,
just press the + and add the extracted GWT directory
A dialog appears and I just unticked all the samples
The "Dependencies Storage Format" needed to be "Intellij IDEA", not Eclipse for this to work for me.