java.lang.NoClassDefFoundError in PluginSdkboxAds

java.lang.NoClassDefFoundError in PluginSdkboxAds
0

Hi @yinjimmy we are getting error below trying to integrate PluginSdkboxAds. Can you please help us out? Thanks!

2019-11-11 20:28:17.818 24776-24804/? I/SDKBOX_CORE: Initialization request for plugin: 'com/sdkbox/plugin/PluginSdkboxAds'
2019-11-11 20:28:17.826 24776-24804/? I/SdkboxAds: Initialization request for AdUnit: 'AdMob'
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame: Rejecting re-init on previously-failed class java.lang.Class<com.sdkbox.plugin.PluginAdMob$3>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/rewarded/RewardedAdCallback;
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.AdMobUnit.<init>(android.content.Context) (AdMobUnit.java:24)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:343)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at com.sdkbox.reflect.AdUnit com.sdkbox.plugin.PluginSdkboxAds.getClassByName(java.lang.String) (PluginSdkboxAds.java:207)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.addProvider(java.lang.String, com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:222)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.createAdUnit(java.lang.String, com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:186)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.createAdUnits(com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:146)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.initialize(com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:78)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int) (Cocos2dxRenderer.java:-2)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig) (Cocos2dxRenderer.java:74)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1539)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1270)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.rewarded.RewardedAdCallback" on path: DexPathList[[zip file "/data/app/com.MyGame.MyGamed-dvQOT1SJaNGqmQFTd6z5NQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.MyGame.MyGamed-dvQOT1SJaNGqmQFTd6z5NQ==/lib/arm, /data/app/com.MyGame.MyGamed-dvQOT1SJaNGqmQFTd6z5NQ==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:134)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.AdMobUnit.<init>(android.content.Context) (AdMobUnit.java:24)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:343)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at com.sdkbox.reflect.AdUnit com.sdkbox.plugin.PluginSdkboxAds.getClassByName(java.lang.String) (PluginSdkboxAds.java:207)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.addProvider(java.lang.String, com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:222)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.createAdUnit(java.lang.String, com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:186)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.createAdUnits(com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:146)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.initialize(com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:78)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int) (Cocos2dxRenderer.java:-2)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig) (Cocos2dxRenderer.java:74)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1539)
2019-11-11 20:28:17.837 24776-24804/? I/.MyGame:     at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1270)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame: Rejecting re-init on previously-failed class java.lang.Class<com.sdkbox.plugin.PluginAdMob$3>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/rewarded/RewardedAdCallback;
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.AdMobUnit.<init>(android.content.Context) (AdMobUnit.java:24)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:343)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at com.sdkbox.reflect.AdUnit com.sdkbox.plugin.PluginSdkboxAds.getClassByName(java.lang.String) (PluginSdkboxAds.java:207)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.addProvider(java.lang.String, com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:222)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.createAdUnit(java.lang.String, com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:186)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.createAdUnits(com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:146)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.initialize(com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:78)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int) (Cocos2dxRenderer.java:-2)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig) (Cocos2dxRenderer.java:74)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1539)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1270)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.rewarded.RewardedAdCallback" on path: DexPathList[[zip file "/data/app/com.MyGame.MyGamed-dvQOT1SJaNGqmQFTd6z5NQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.MyGame.MyGamed-dvQOT1SJaNGqmQFTd6z5NQ==/lib/arm, /data/app/com.MyGame.MyGamed-dvQOT1SJaNGqmQFTd6z5NQ==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:134)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.AdMobUnit.<init>(android.content.Context) (AdMobUnit.java:24)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:343)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at com.sdkbox.reflect.AdUnit com.sdkbox.plugin.PluginSdkboxAds.getClassByName(java.lang.String) (PluginSdkboxAds.java:207)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.addProvider(java.lang.String, com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:222)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.createAdUnit(java.lang.String, com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:186)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.createAdUnits(com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:146)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void com.sdkbox.plugin.PluginSdkboxAds.initialize(com.sdkbox.plugin.JSON) (PluginSdkboxAds.java:78)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int) (Cocos2dxRenderer.java:-2)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig) (Cocos2dxRenderer.java:74)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1539)
2019-11-11 20:28:17.838 24776-24804/? I/.MyGame:     at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1270)

Found the issue. Adding this below fixed it!

implementation 'com.google.android.gms:play-services-ads:17.2.0'

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.