Can't build after Facebook SDK, launcher:compileReleaseJavaWithJavac FAILED

Hi! Recently I added Facebook SDK to my game. And since then build fails. I tried every solution I found but nothing worked.

There is also Google Mobile Ads SDK in my game. But before Facebook I could build successfully with Google Mobile Ads SDK.

Please if anyone know anything about this let me know. I need to solve this as soon as possible to be able to create ad campaign on Facebook.

Unity 2019.4.40.f1
Google Mobile Ads SDK v7.3.0
Facebook SDK v14.1.0

> Task :unityLibrary:transformNativeLibsWithIntermediateJniLibsForRelease
> Task :launcher:processReleaseResources
> Task :launcher:javaPreCompileRelease

> Task :launcher:compileReleaseJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
55 actionable tasks: 55 executed

Note: C:\Users\aktas\Documents\GitHub\ColorSphereMatch\ColorSphereMatch\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
An exception has occurred in the compiler (1.8.0-adoptopenjdk). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output<message truncated>

CommandInvokationFailure: Gradle build failed. 
C:/unityeditorfolder/2019.4.40f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Users\aktas\Documents\gradle-6.0.1\lib\gradle-launcher-6.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

stderr[
Note: C:\Users\aktas\Documents\GitHub\ColorSphereMatch\ColorSphereMatch\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
An exception has occurred in the compiler (1.8.0-adoptopenjdk). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)

While I was randomly trying to solve the problem, somehow I found a solution. I’ve been looking for a solution on the internet for almost a week and there is no solution I haven’t tried. I am really disgusted with Facebook, it has caused me problems in every field and wasted my time. But unfortunately I have to use it for now.
I will tell you what I did to solve it. I would be very happy if I could even help someone with the same problem.

First off all I thought maybe the problem was on android sdk tools. In android studio there is a few versions partially installed. I thought there can be a conflict here. To solve it completely I uninstalled the studio and reinstalled it. Then installed versions you can see in the image;
Android API 30

Build Tools 30.0.0

continue in the comments;