Google Ads Unity Plugin - how to reduce size in build for Instant App?

121 views
Skip to first unread message

Victor Moldoveanu

unread,
Mar 18, 2021, 12:35:07 PM3/18/21
to Google Mobile Ads SDK Developers
Hi,
I have an instant app that I want to add google ads to.
The size limitation for instant apps is that the initial download size must not exceed 15 MB.
These are my numbers before adding google ads plugin for unity (13.68 arm64 / 13.16 armeabi)
Capturebefore.PNG

Now, If I add the plugin, then the new sizes are (15.15 / 14.63)
Captureafter.PNG
This adds 1.47 MB to my build size, going above the 15 MB limit for arm 64. This is not acceptable and also I would like to have a little room for extra code from my side.

Is there a way to reduce the size that the google ads adds to my build size?
I have found this page https://developers.google.com/admob/android/lite-sdk (Google Mobile Ads Lite SDK) that looks like something that I need, but how do I make this work with the Unity Plugin?

Thanks,
- Victor

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 18, 2021, 5:11:04 PM3/18/21
to victor.m...@gmail.com, google-adm...@googlegroups.com
Hi Victor,

Thank you for bringing this issue to our attention. We see that this is apparently an issue for you that this pushes your app just a bit over the limit. While we would definitely suggest using the Lite version as this should help to reduce the file size even more. At less then 2mb this is a pretty small file. 

Also having looked over this article on this. I would look to see if you could refactor the code down a bit more for module expansion. Which even they say to make the featiure module as ligth as possible and then build out new modules to keep it light.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 

 

ref:_00D1U1174p._5004Q2DwoQm:ref

Victor Moldoveanu

unread,
Mar 22, 2021, 8:38:29 AM3/22/21
to Google Mobile Ads SDK Developers
Thanks for your answer.

I have switched to using the LITE version and everything is ok.

However:

Here's a new question somehow related:

If I use the Unity Mediation Plugin

then the FULL version of the Google Mobile Ads gets added to my build. How can I make the Google Mobile Ads Unity Ads Mediation Plugin use the LITE version instead of the full version?

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 22, 2021, 9:50:34 AM3/22/21
to victor.m...@gmail.com, google-adm...@googlegroups.com
Hi Victor,

Thank you for the response back. Glad to hear that the LITE version was able to help to reduce the file size for you. As for the second question I do believe that this will not work as well for you. As you have stated the mediation requires that you are working on the standard SDK. Thus is not able to work on the Lite version. Since as you said it pulls in the regular SDK version.
Reply all
Reply to author
Forward
0 new messages