Unity: java.lang.ClassNotFoundException: com.google.android.ump.UserMessagingPlatform

890 views
Skip to first unread message

Dror Cohen

unread,
Jun 12, 2023, 4:16:39 AM6/12/23
to Google Mobile Ads SDK Developers
Hey there,

I'm getting the following exception after adding following the AdMob privacy messaging guide

2023/06/11 21:18:36.678 2083 2178 Error Unity AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.ump.UserMessagingPlatform
2023/06/11 21:18:36.678 2083 2178 Error Unity java.lang.ClassNotFoundException: com.google.android.ump.UserMessagingPlatform
2023/06/11 21:18:36.678 2083 2178 Error Unity at java.lang.Class.classForName(Native Method)
2023/06/11 21:18:36.678 2083 2178 Error Unity at java.lang.Class.forName(Class.java:453)
2023/06/11 21:18:36.678 2083 2178 Error Unity at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
2023/06/11 21:18:36.678 2083 2178 Error Unity at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
2023/06/11 21:18:36.678 2083 2178 Error Unity at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:83)
2023/06/11 21:18:36.678 2083 2178 Error Unity at android.os.Handler.dispatchMessage(Handler.java:102)
2023/06/11 21:18:36.678 2083 2178 Error Unity at android.os.Looper.loop(Looper.java:214)
2023/06/11 21:18:36.678 2083 2178 Error Unity at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
2023/06/11 21:18:36.678 2083 2178 Error Unity Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.ump.UserMessagingPlatform" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.NinetyThreeBases.IdlePizza-GS7GI1qAZINIkeE-uRP-lw==/base.apk"],nativeLibraryDirectories=[/data/app/com.NinetyThreeBases.IdlePizza-GS7GI1qAZINIkeE-uRP-lw==/lib/arm64, /data/a

This only happens on a real device, and doesn't happen in the editor.

Any help will be greatly appreciated.

Thanks.

Mobile Ads SDK Forum Advisor

unread,
Jun 16, 2023, 11:54:34 AM6/16/23
to dr...@tinker-labs.com, google-adm...@googlegroups.com

Hi,

Thank you for reaching out to us.

For us to further investigate this error in your end, can you provide us more information below?

  • sample app project where the error is reproducible
  • steps to replicate
  • SDK version
  • Affected device and versions
  • App ID

You can provide the following details via reply on this thread or directly provide it to the link below.

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, you can share your files with me by performing the following steps:

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=5004Q00002mBsGKQA0&entry.80707362=00183678

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.

This message is in relation to case "ref:_00D1U1174p._5004Q2mBsGK:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Dror Cohen

unread,
Jun 18, 2023, 9:32:42 AM6/18/23
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
Thank you.

I think I've been able to find the cause, but no solution yet. If I disable R8, UMP seems to be working, but then I get other issues like scenes not loading and my builds break due to "unity WARNING: The option setting 'android.enableR8=false' is deprecated."
In the link provided, I sent a Unity project with R8 enabled through the link provided.

To replicate, simply build for a real android device, and then you should see the exception. It should appear after the Debug.Log command with the following string "UMP after request".

The AdMob Unity plugin version used is GoogleMobileAds-v8.2.0

It's running on Samsung Galaxy S8 with Android 9.

Thank you.

--
Dror Cohen
Indie Dev of Power Inc.
Follow Power Inc on Discord | Reddit | Twitter 

Mobile Ads SDK Forum Advisor

unread,
Jun 20, 2023, 2:25:44 PM6/20/23
to dr...@tinker-labs.com, google-adm...@googlegroups.com

Hi Dror,

Thank you for your response.

Upon checking the link we've provided, it seems that your project file is not yet uploaded. With that, can you upload it again so we can test it in our end? In addition to that, can you confirm if you tested it also in the latest version of Unity (https://github.com/googleads/googleads-mobile-unity/releases/tag/v8.3.0)? Asking it, as there are some updates on the latest version. In addition to that, kindly provide us the version of the devices where this is reproducible. 

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, you can share your files with me by performing the following steps:

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=5004Q00002mBsGKQA0&entry.80707362=00183678

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link. 

Dror Cohen

unread,
Jun 25, 2023, 9:48:35 AM6/25/23
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
I can confirm that I'm using v8.3.0 and this has been resolved thanks to adding this clause to the proguard-users.txt file:

-keep public class com.google.android.ump.**{
   public *;
}


I think Google should really add it to the documentation, 

Mobile Ads SDK Forum Advisor

unread,
Jun 26, 2023, 5:03:12 PM6/26/23
to dr...@tinker-labs.com, google-adm...@googlegroups.com

Hi Dror,

We're glad to know that you're able to find a work around in the error you've encountered. However, since we're unable to replicate this in our end, if you can provide us your sample project file where the error is reproducible and the sample app that is now working, we can check this to the wider team if this is indeed need to be update on the Unity plugin or if this is just a workaround for now.

Reply all
Reply to author
Forward
0 new messages