Recently, I tried to add Facebook Audience Network as an open bidding ad source using the AdMob mediation plugin for Unity. After importing the Facebook mediation plugin, Unity starts to auto resolve conflicting dependencies, this is usually fine and is recommended. However in this case, the external dependency manager decides to upgrade Google Play Services to version 20.0.0. This is where the problem arises, the Facebook Audience Network 220.127.116.11 is not compatible with Google Play Services 20.0.0, causing a crash when trying to request an ad. There are multiple people that experienced the same problem here. Apparently some people managed to get it working by simply downgrading Google Play Services to a previous version. In the end, I found a workaround solution that works for me. Remember to backup your project files if you decided to try it out.
- Import the Facebook mediation plugin and let Unity auto resolve any conflicting dependencies.
- Download the following 4 files from the maven repository. I chose Google Play Services 19.8.0 because I have other plugins that requires a minimum of version 19.8.0. You can check the min version required by Facebook mediation plugin here.
- In the Unity editor, go to Assets->External Dependency Manager->Android Resolver->Settings and disable “Enable Auto-Resolution” and “Enable Resolution On Build“. This is important so that Unity does not try to upgrade the files we going to replace later back to version 20.0.0.
- From the Project Browser, navigate to the Assets/Plugins/Android folder, then delete version 20.0.0 of the 4 files we downloaded previously and replace them with the 19.8.0 equivalents.
- Build and check if ads is serving as intended.
Note that we have now turn off auto resolution of dependencies and if you ever enable it again (perhaps to resolve dependencies for other plugins you import later), Unity will upgrade Google Play Services to the problematic version 20.0.0 and you will have to repeat the steps above again. Until google updates their Google AdMob Unity Plugin to support Google Play Services 20.0.0, I hope this workaround helps someone that is facing similar issues. Cheers!