googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.36k stars 1.08k forks source link

Crash on Reward Video Completed on Android #723

Closed avinash018 closed 6 years ago

avinash018 commented 6 years ago

Hello,

I am using 3 mediation networks with admob to get ads. Facebook, UnityAds, IronSource. When the rewarded ad played from unity ads, it was showing test ads because i added the device as test device. Then after closing the ad the app crashes immediately throwing this exception.

I`ve tried one of you solutions by updating the version of the Google Mobile Ads SDK from 12.0.1 to 15.0.1 in Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml Still the app is crashing. Dont know why. Can you please look into it.

07-17 19:07:16.500 27983-27983/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.petjump.android, PID: 27983 java.lang.Error: FATAL EXCEPTION [main] Unity version : 2017.4.5f1 Device model : motorola Moto G (5S) Plus Device fingerprint: motorola/sanders_n/sanders_n:7.1.1/NPSS26.116-61-11/18:user/release-keys

                                               Caused by: java.lang.NoSuchMethodError: No interface method onVideoCompleted(Lcom/google/android/gms/ads/reward/mediation/MediationRewardedVideoAdAdapter;)V in class Lcom/google/android/gms/ads/reward/mediation/MediationRewardedVideoAdListener; or its super classes (declaration of 'com.google.android.gms.ads.reward.mediation.MediationRewardedVideoAdListener' appears in /data/app/com.petjump.android-1/base.apk)
                                                   at com.google.ads.mediation.unity.UnityAdapter$1.onUnityAdsFinish(UnityAdapter.java:159)
                                                   at com.google.ads.mediation.unity.UnitySingleton$UnitySingletonListener.onUnityAdsFinish(UnitySingleton.java:222)
                                                   at com.unity3d.ads.api.Listener$3.run(Listener.java:44)
                                                   at android.os.Handler.handleCallback(Handler.java:751)
                                                   at android.os.Handler.dispatchMessage(Handler.java:95)
                                                   at android.os.Looper.loop(Looper.java:154)
                                                   at android.app.ActivityThread.main(ActivityThread.java:6165)
                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)

Thanks in advance.

rampara commented 6 years ago

@avinash018 are you including all of the files from the Unity Ads mediation support package and following integration instructions from the Unity Ads mediation developer docs?

waht123msn commented 6 years ago

I have the same error,after I udate the 3.15.0,not work.And then I check my project on the android studio,find the verison11 in it,So I delete it ,hahhah, it finally worked!!!!!! // compile(name: 'play-services-ads-lite-11.0.4', ext:'aar') // compile(name: 'play-services-basement-11.0.4', ext:'aar') // compile(name: 'recyclerview-v7', ext:'aar') // compile(name: 'support-compat', ext:'aar') // compile(name: 'support-core-ui', ext:'aar') // compile(name: 'support-core-utils', ext:'aar') // compile(name: 'support-v4-25.3.1', ext:'aar') // compile(name: 'support-v4', ext:'aar')

rampara commented 6 years ago

@waht123msn glad you were able to resolve your issue.

avinash018 commented 6 years ago

@rampara Thanks for the response. Actually i added all of the files as per the guidelines given Unity ads mediation for Android developer docs. The issue was solved buy downgrading the unity ads file to the previous version.

They mentioned to use the latest files in the links provided. I used the latest files only. But later i noticed that the unity-ads.aar file is updated 5 days ago when i downloaded it . But the adapter is updated one month ago. So there is some mismatch with them and it causes error.

But the question is when i implemented the android manual integration mentioned above and imported the UnityMediationDependencies.xml file to my project then only ads are loading. If i missed any of the mentioned the ads are not loading. Why? As per Unity Ads mediation developer docs i dont need to do the manual integration of android i.e,. Adding the Unity-ads and unity adapter aar files to plugins folder. But with out doing this i am not getting the ads. Can you look into this?

Thanks and regards. Avinash Ch.

rampara commented 6 years ago

@avinash018 integrating with Unity Ads should not require any additional steps beyond importing the Unity Ads mediation support package and resolving dependencies. If you already manually included any Unity Ads artifacts you may have to remove them yourself. For additional integration support, I would recommend you reach out on the Google Mobile Ads Technical Support Forum.

ebrahim--hsh commented 5 years ago

I use Invoke to put some delays to call whatever I need to do, It works for me like a charm.

avinash018 commented 5 years ago

@ebrahim--hsh Why you spoke about Invoke here? Is your comment related to my question?

I use Invoke to put some delays to call whatever I need to do, It works for me like a charm.

aliiskla commented 4 years ago

I use Invoke to put some delays to call whatever I need to do, It works for me like a charm.

Thank u man i used an invoke as u tell and it really work just fine...........bless u my man