Search Unity

java.lang.ClassNotFoundException: com.unity3d.services.monetization.UnityMonetization

Discussion in 'Unity Ads & User Acquisition' started by RSH1, Jun 16, 2019.

Thread Status:
Not open for further replies.
  1. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    256
    Unity ads are working fine in the editor, but attempting to run on Android device gives the following error:

    Code (CSharp):
    1.     06-16 12:53:40.068 27713 27737 E Unity   : Error Initializing Unity Monetization.
    2. 06-16 12:53:40.068 27713 27737 E Unity   :
    3. 06-16 12:53:40.068 27713 27737 E Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
    4. 06-16 12:53:40.068 27713 27737 E Unity   :
    5. 06-16 12:53:40.078 27713 27737 E Unity   : AndroidJavaException: java.lang.ClassNotFoundException: com.unity3d.services.monetization.UnityMonetization
    6. 06-16 12:53:40.078 27713 27737 E Unity   : java.lang.ClassNotFoundException: com.unity3d.services.monetization.UnityMonetization
    7. 06-16 12:53:40.078 27713 27737 E Unity   :      at java.lang.Class.classForName(Native Method)
    8. 06-16 12:53:40.078 27713 27737 E Unity   :      at java.lang.Class.forName(Class.java:324)
    9. 06-16 12:53:40.078 27713 27737 E Unity   :      at java.lang.Class.forName(Class.java:285)
    10. 06-16 12:53:40.078 27713 27737 E Unity   :      at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    11. 06-16 12:53:40.078 27713 27737 E Unity   :      at com.unity3d.player.UnityPlayer.c(Unknown Source)
    12. 06-16 12:53:40.078 27713 27737 E Unity   :      at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source)
    13. 06-16 12:53:40.078 27713 27737 E Unity   :      at android.os.Handler.dispatchMessage(Handler.java:98)
    14. 06-16 12:53:40.078 27713 27737 E Unity   :      at android.os.Looper.loop(Looper.java:158)
    15. 06-16 12:53:40.078 27713 27737 E Unity   :      at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
    16. 06-16 12:53:40.078 27713 27737 E Unity   : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.services.monetization.UnityMonetization" on path: DexPathList[[zip file "/data/app/com.company.game-2/base.apk", zip file "/data/app/com.company.game-2/split_config.armeabi_v7a.apk"],nativeLibraryDirectories=[/data/app/com.company.game-2/lib/arm, /data/app/com.company.ho
    Using 2019.1.6f1 with both the "Build App Bundle" option and the old apk build method.
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @RSH1

    It seems like the Ads package, or part of it, is getting stripped out of the build somehow.
    • How did you install the Unity Ads package? Asset Store or Services Window/Package Manager?
    • What version did you install?
    • Which namespace are you using: Advertisements or Monetization?
    • Did you change any of the defaults in the player settings (aside from the bundle id) when building?
     
  3. dgtgamesmobile

    dgtgamesmobile

    Joined:
    Aug 8, 2021
    Posts:
    1
    Did you solve this issue?
     
Thread Status:
Not open for further replies.