I have installed the ‘Advertisement Legacy’ package (version 4.12.0) in a project. Since then, I have been getting error messages when I try to build the project for Android. When I start the build process, the following two error messages appear.


I have already looked for solutions on the Internet and tried to solve it by linking to the SDK folder of Android Studio in the preferences.
As a result, the previous error messages no longer appeared, but the version of the platform tools was no longer recognised.

I have a ‘platform-tools’ folder in both folders, Unity and Android Studio. So why is it not recognised?
Before installing the Advertisement Package, I was able to create a build without any problems. Why doesn’t it work now?
Unity version: 2022.3.24
It is recommended to use tools installed with Unity. Give it a try 
That’s what I did at the beginning. Then the two error messages appeared.
Only then did I change the SDK folder.
If you can tell me how to fix the first two error messages, I would like to use the tools installed with Unity.
Check your JAVA_HOME env variable. Error says that it points to Android SDK
Where can I find the JAVA_HOME env variable? And where should it point to?
It is defined in your system environment variables. Should point to Java installation.
But as far as I can see errors are coming from Android Resolver, probably External Dependency Manager. Try updating it to the latest version: Release EDM4U 1.2.182 · googlesamples/unity-jar-resolver · GitHub
And keep all the tools installed with Unity
Updating the dependency manager did not work.
When I wanted to change the JAVA_HOME variable, I realised that I didn’t have a Java Development Kit installed, so I installed one and set the variable to the correct path. But the errors are still the same.
Try completely removing dependency resolver and importing latest version. If that doesn’t help - share a minimal repro project so I could take a look
Thanks, that solved the problem.