I have found out how to fix the problem. This is for everyone who wants use Ads Mediation package.
1- Install Ads Mediation from Unity package manager.
2- When installing finished, there will be a pop up that asks you to install "Mobile Dependency Manager". Click to NO. This is important.
3- Check your Assets folder if there are any "Mobile Dependency Manager" or "External Dependency Manager". If you find, delete all folders.
4- Go to Assets/Plugins/Android folder. Delete everything on it.
5- Go back to Unity. Open the package manager. Install the External Dependency Manager from the plus icon that is on the left corner. Select "Install package git URL". Paste this URL:
https://github.com/googlesamples/unity-jar-resolver.git?path=upm
It is going to install, and you will see the package on package manager when It is finished.
6- Close package manager. Click Assets -> External Dependency Manager -> Android Resolver -> Force Resolve tab. It will make force resolve and you should see a pop up that says something like "Resolve Succeded".
7- You can now build your project. The problem will be solved.