Unity 2022.2 complains about things that don't exist, Android, Quest

I have upgraded my project from Unity 2021, into Unity 2022.
I was able to build the project in 2021, and run it on the Oculus Quest 2.
The issue is that now I cannot build the apk.

It complains about missing files in Assets/Plugins/Android, eventhough I deleted that folder.
In addition it says that JAVA_HOME points to a folder or not pointing to a folder, which also isn’t true.

Where does those made up issues come from?

I tried to delete all sort of Android plugins and files, nothing works, nothing tells me who is looking for plugions on the Android plugin folder?

What is going on?

8671497--1168191--upload_2022-12-18_21-19-46.png

I am also having issues regarding the android APK upon updating to 2022.2.1. Our issue is that, althought it will build, it only opens in flatscreen mode on the quest. One tip I could recommened, though I don’t have the same issue as you, is to try checking and unchecking all the NDK, SDK, JAVA stuff in Editor Preferences->External Tools. This can reset the pathsand help unstick the things sometimes.

Ok, I figured the issue…

Somehow a service of advertisement called mediation package was installed.
This screwed up everything.
I guess Unity installs this when you move to 2022, without telling you.

After removing it, it solved my android plugins missing issue.

However, I still got the JAVA_HOME issue.
For that I uninstall Android Studio, Uninstall the Unity Editor. And installed it again with Java support.
That still didn’t solve it.
I saw that it complains about the JAVA_HOME in PATH and not in the environment variable.
I set the JAVA_HOME path like this:
setx /m JAVA_HOME “C:\Program Files.…”
But I was still getting the JAVE_HOME error
So I tried to change the path to the java I installed recently, int he external tools settings.
But it said that it needs JDK 18 an not 19.
I had 19 installed.
So I set the JAVA_HOME path, to the OpenJDK that was installed by unity.

This solved the JAVA_HOME issue, and I could compile.