AndroidJavaException: java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzkj

279 views
Skip to first unread message

Anton Podolskiy

unread,
Jun 22, 2018, 7:33:39 AM6/22/18
to Google Mobile Ads SDK Developers
I can't use googleads-mobile-unity because of an exception when i call methods to show the ad banner:

06-14 14:46:07.792 9124-9155/? E/Unity: AndroidJavaException: java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzkj
    java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzkj
        at com.google.android.gms.internal.zzlc.<init>(Unknown Source)
        at com.google.android.gms.internal.zzlc.<clinit>(Unknown Source)
        at com.google.android.gms.internal.zzmz.zza(Unknown Source)
        at com.google.android.gms.ads.MobileAds.initialize(Unknown Source)
        at com.google.android.gms.ads.MobileAds.initialize(Unknown Source)
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
        at com.unity3d.player.UnityPlayer.c(Unknown Source)
        at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
        at android.os.MessageQueue.next(MessageQueue.java:404)
        at android.os.Looper.loop(Looper.java:137)
        at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
      at UnityEngine.AndroidJNISafe.CheckException () [0x00091] in <c876828f1e734346a83673631df716a4>:0 
      at UnityEngine.AndroidJNISafe.CallStaticVoidMethod (System.IntPtr clazz, System.IntPtr methodID

If I understand correctly, then there are some problems with the resolution of dependencies. I tried all the solutions that I found in the community. The standard resolution of dependencies occurs regularly and ends with success.
There result of resolution.

I tryed press the Forse Resolve button. I got this.


I do not know what this error is at the end, and how to solve it, I did not find any information about it in the community. Maybe this is somehow connected?

My engine: Unity 2017.4.2f2 (64-bit)

Plugin: Google Mobile Ads Unity Plugin v3.13.1

Also in project i use: firebase_unity_sdk_5.0.0 - FirebaseMessaging

Sorry for my English.

P.S.: Also i found this warning:


It will probably be useful to describe the situation as this problem appeared. First of all, there was an add-on of the [Google Mobile Ads Unity Plugin v3.13.1] plug-in, it was tested and it worked. But then we added the[Firebase Unity SDK] (FirebaseMessaging.unitypackage in this archive) plug-in and after that the first plug-in stopped working, for the reason that this exception appeared.

I attached files to the message which I think are relevant to the problem. These are Android files of two plugins that contain native code. We do not use other plugins containing fully native code. Also there are some other files that can be useful in solving problems, such as PlayServicesResolver files.
I tried both the resolve options, including the one you suggested, it's not helped.
I will try to reproduce the same issue via building HelloWorld sample app after adding the [Firebase Unity SDK] (FirebaseMessaging.unitypackage in this archive). And then i will give you the results of that experiment.
Unfortunately I can not provide a copy of our project.
If you'll need any additional information, i'll glad to give it.


sandeep Nsk

unread,
Jun 22, 2018, 8:51:28 AM6/22/18
to Google Mobile Ads SDK Developers
Try replacing 
1. com.google.android.gms.play-services-ads-license-12.0.1.aar
2. com.google.android.gms.play-services-ads-lite-12.0.1.aar
3. com.google.android.gms.play-services-ads-lite-license-12.0.1.aar
4. com.google.android.gms.play-services-ads-12.0.1.aar
5. com.google.android.gms.play-services-gass-12.0.1.aar
6.  com.google.android.gms.play-services-gass-license-12.0.1.aar 
with 15.0.1 version of all

mobileadssdk-a...@google.com

unread,
Jun 22, 2018, 3:24:05 PM6/22/18
to sandeep Nsk, Google Mobile Ads SDK Developers
Hello Anton, 

Can you make sure that you imported the plugin by following the steps mentioned in this guide? The Unity samples currently use a Play services version of 12.0.1. Can you make sure if making this change resolves the issue? If yes, let me know so I can share this with the team. 

Thanks,
Bharani Cherukuri
Mobile Ads SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Reply all
Reply to author
Forward
0 new messages