Unity XCode iOS / Why is Unity Ads and mediation an Pod in my project?

Hello,
i want to publish my unity game to ios.

But when i try to archive it in XCode, i got this error:
Undefined symbol: OBJC_CLASS $_UnityAds (See here the full error code)

Other Projects of mine dont have this problem.

I dont want to use UnityAds.
When i have a look to the pods, there is one pod called “UnityAds” and some “Unity Mediation…” pods.

Could this pods be the problem?
What determines which pods are displayed and required here?
How can I remove these dependencies on Unity Ads and mediation? I have already completely removed Unity Ads from the project.

I solved the problem by deleting all files from my project that contained “mediation” or “unityAds”.

Unity create incorrect Podfile

In case there is some weird dependencies appear in Podfile generated by Unity build iOS:

  • Check and remove junks: Recheck all project if there is any mistake or remaining junk, unexpected, forgotten remove dependencies. If there are any, just remove them.

  • Restart Editor: After make sure all dependencies clean, but Unity still generate iOS project with incorrect dependencies in Podfile, we should restart Unity and clean rebuild the project, because the configs can be cache in the current opening session and make the generate build unsync and incorrect with the project state.