Using "Release" minification (Proguard) in Unity

2,764 views
Skip to first unread message

FreeLearning

unread,
Aug 21, 2021, 2:02:14 PM8/21/21
to Google Mobile Ads SDK Developers
Hi, I'm trying to reduce the space occupied by my app, and I was thinking of enabling the "Release" minification (which if I'm not mistaken uses Proguard) in the "Publishing settings" section in the "Android Player Settings" section.

I've tested the app on a test device and I'm showing test ads (so everything seems to be fine). But I remember reading things about editing a custom Proguard file. However, perhaps over time you have inserted an automatic system that modifies it, I don't know.

So the question is: using minification, do I have to add lines to a Proguard file, or does your plugin do it directly?
If so, what are the red flags that would make me realize that there is a problem with minification?

I am currently using Google Mobile Ads Unity Plugin version 5.4.0, hoping to be able to update it to 6.1.0 when they release it.

Mobile Ads SDK Forum Advisor

unread,
Aug 23, 2021, 5:54:53 AM8/23/21
to freelearni...@gmail.com, google-adm...@googlegroups.com
Hi FreeLearning,

Thank you for reaching out to us.

With regard to your concern, we're seeing other publisher reported an issue after minifying their code, so it would be best not to do it on Mobile Ads SDK. However, if you still need this, then you will have to check the ProGuard option (Player Settings -> Publishing Settings -> Build -> User Proguard File) and force the compiler to retain the AdMob SDK classes in the final build. You may check this link for further details.

In addition, you may try exporting your project over to Android Studio instead and build from there in case your build using Unity fail (Build Settings -> Export Project).

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Mhhd8:ref

FreeLearning

unread,
Aug 23, 2021, 1:04:41 PM8/23/21
to Google Mobile Ads SDK Developers
Thanks for the info

FreeLearning

unread,
Nov 9, 2021, 12:59:56 PM11/9/21
to Google Mobile Ads SDK Developers
Hi,

Dust off this thread to ask for a clarification. The errors reported by users after minification, were given by what? What did these errors cause? Failure of the build? Or did the build work and the ads didn't? Or did both build and ads work but sometimes they didn't show? If I understand what problem it was showing in practice, I would be able to run the appropriate tests before release. That is, if you tell me that the minification error caused the build to fail then I know that if it builds correctly I have no problems. Or if you tell me it didn't show ads and if from my tests it shows them I shouldn't have a problem. What test step can I take to understand if AdMob is working correctly after minification? What tests can guarantee me that if I release the app there will be no problems? (I refer both to a manual test on the app (for example if the ads appear), and to a more technical test perhaps checking something in particular in the change file generated by Unity after the build (the file in which all the class changes))

Mobile Ads SDK Forum Advisor

unread,
Nov 9, 2021, 9:04:44 PM11/9/21
to freelearni...@gmail.com, google-adm...@googlegroups.com
Hi FreeLearning,

Thank you for reaching out to us again about this issue. Having looked over this, I am unsure if we can fully answer this question. As it is not something that we supported then and still do not today. We do not have any sample app that uses it or have any exposure to the results of using it. There is not much feedback that we have about this other then what has been previously stated.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Mhhd8:ref
Reply all
Reply to author
Forward
0 new messages