UMP SDK and proguard

488 views
Skip to first unread message

Christopher

unread,
Nov 2, 2023, 9:36:06 AM11/2/23
to Google Mobile Ads SDK Developers
I'm currently working on implementing the UMP SDK 2.1.0 in my Android mobile apps. 
In my apps I use the "minifyEnabled" option. Should I add some proguard rules to the app because of this?

Thank you

Mobile Ads SDK Forum Advisor

unread,
Nov 3, 2023, 3:52:20 AM11/3/23
to kreosof...@gmail.com, google-adm...@googlegroups.com

Hi Christopher,

Thank you for contacting the Mobile Ads SDK support team.

I have reviewed your concern and understand that you are inquiring about whether or not you must add proguard rules when minification is enabled.

Yes, it is a good practice to add proguard rules to your app's ProGuard configuration file when you use the "minifyEnabled" option in your Android app. This will ensure that the UMP SDK functions properly. If you are using the Adaptive Banner with "minifyEnabled=true", you can use the following proguard rules for Adaptive Banner. If you are using the Banner with "minifyEnabled=true", you can use the following proguard rules for Banner.

I hope this information is helpful. Please let me know if you have any other questions.

This message is in relation to case "ref:!00D1U01174p.!5004Q02q9xdV:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Christopher

unread,
Nov 3, 2023, 6:03:41 PM11/3/23
to Google Mobile Ads SDK Developers
I'm asking about the "User Messaging Platform" library for Android, not "Mobile Ads SDK". Does using the " User Messaging Platform"  library require proguard configuration if I use "minifyEnabled" in Android app?

Mobile Ads SDK Forum Advisor

unread,
Nov 6, 2023, 2:28:12 AM11/6/23
to kreosof...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for getting back to us.

Yes, using the User Messaging Platform (UMP) library for Android requires proguard configuration if you use minifyEnabled in your Android app. This is because UMP uses some classes that are not used by other parts of your app, and these classes need to be kept in the final APK file. To do this, you need to add the following lines to your proguard.txt file:

class com.google.firebase.messaging.** { *; }
class com.google.firebase.iid.** { *; }

These lines will tell proguard to keep all classes in the com.google.firebase.messaging and com.google.firebase.iid packages. This will ensure that UMP can function properly in your app.
Please reach out to us, if you need any further assistance.

Andreas

unread,
Nov 6, 2023, 7:43:53 AM11/6/23
to Google Mobile Ads SDK Developers
One of those classes has been deprecated for longer than the whole UMP SDK even existed. I also can't find it among the dependencies of one of my projects that uses the UMP SDK. Please check if that answer is anywhere near correct.

Christopher

unread,
Nov 6, 2023, 9:11:04 AM11/6/23
to Google Mobile Ads SDK Developers
I don't understand where this answer comes from. The UMP package is not dependent on firebase. The provided proguard configuration does not change anything in the resulting apk file. The apk file size has not changed.

Mobile Ads SDK Forum Advisor

unread,
Nov 7, 2023, 12:10:17 AM11/7/23
to kreosof...@gmail.com, google-adm...@googlegroups.com
Hi,

Thank you for getting back to us.

Please refer to the Proguard rules for more details about it. If the issue still persists,  kindly provide your sample application for further investigation. 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, kindly provide requested information to us via reply privately to author option or using the steps below:

1. Navigate to
https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002q9xdVQAQ&entry.80707362=00208764
2. Fill out all fields, and attach your file(s).
3. Please reply back to this thread when you have uploaded your file(s). Please do not share this link.
Reply all
Reply to author
Forward
0 new messages