Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Ads - No such proxy method on Android

Discussion in 'Unity Ads & User Acquisition' started by IceCatGames, Mar 27, 2017.

  1. IceCatGames

    IceCatGames

    Joined:
    Mar 22, 2016
    Posts:
    33
    Hello,
    Recently I updated Unity from 5.4.x to 5.5.2f1. All things in my game worked good, so I maked a build and released it. After that I started to receive a lot of exceptions to Unity perfomance console:

    Code (CSharp):
    1.  
    2.  
    3. MESSAGE
    4. Exception: No such proxy method: UnityEngine.Advertisements.Android.Platform.onUnityAdsFinish(UnityEngine.AndroidJavaObject,UnityEngine.AndroidJavaObject)
    5.  
    6. STACK TRACE
    7. UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, System.Object[] args)
    8. UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, UnityEngine.AndroidJavaObject[] javaArgs)
    9. UnityEngine._AndroidJNIHelper.InvokeJavaProxyMethod (UnityEngine.AndroidJavaProxy proxy, IntPtr jmethodName, IntPtr jargs)
    10.  
    11.  
    I didn't change anything in my code which worked good with previous version of Unity. Here's the ads class:
    Code (CSharp):
    1.  
    2. using System;
    3. #if (UNITY_IOS || UNITY_ANDROID)
    4. using UnityEngine.Advertisements;
    5. #endif
    6.  
    7. public class UnityAdsController : IVideoAdsProvider
    8. {
    9.     public void ShowVideoAd(Action<bool, bool> callback)
    10.     {
    11.         #if (UNITY_IOS || UNITY_ANDROID)
    12.         ShowOptions options = new ShowOptions();
    13.         options.resultCallback = (ShowResult result) =>
    14.         {
    15.             switch (result)
    16.             {
    17.                 case ShowResult.Failed:
    18.                     if (callback != null)
    19.                         callback(false, false);
    20.                     break;
    21.                 case ShowResult.Skipped:
    22.                     if (callback != null)
    23.                         callback(true, false);
    24.                     break;
    25.                 case ShowResult.Finished:
    26.                     if (callback != null)
    27.                         callback(true, true);
    28.                     break;
    29.             }
    30.         };      
    31.         Advertisement.Show(null, options);
    32.         #endif
    33.     }
    34. }
    35.  
    Can anyone help me to understand what is going wrong?
     
  2. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Hi,

    Did you integrate Ads from the services window? Are the settings there correct? Have you tried disabling the services window -based integration and using the Asset Store package?
     
  3. IceCatGames

    IceCatGames

    Joined:
    Mar 22, 2016
    Posts:
    33
    Yes, I integrated ads from the services window and checked ads settings after migrating to 5.5.2 - all of the settings are correct.
    I didn't tried to use ads via Asset Store package yet. Can that be a cause of problems?
     
  4. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Hi,

    I'd need to take a closer look at your project to answer that with confidence, but lately some editor versions have had issues with the services window -integration for Ads, and we've thus been recommending to use the Asset Store package to avoid potential issues. If you try the Asset Store package and this resolves your issue - let me know.

    If you feel like you're still stuck - please send a message to unityads-support@unity3d.com and provide a description of your issue along with the game ID(s) involved, log messages, etc. If necessary - I can take a look if you send the project my way.
     
  5. IceCatGames

    IceCatGames

    Joined:
    Mar 22, 2016
    Posts:
    33
    Hi,
    I tried to change integrated Ads package to Asset Store's version - it didn't help.
    I started a private conversation with you and provided a details about the project.
     
  6. IceCatGames

    IceCatGames

    Joined:
    Mar 22, 2016
    Posts:
    33
    mikaisomaa,

    Any news with my problem? I'm still getting a thousands of exception reports for last version of my game every day.
     
    KepleriansTeam likes this.
  7. KepleriansTeam

    KepleriansTeam

    Joined:
    Mar 14, 2014
    Posts:
    31
    Same here, getting 100+ exceptions/day in "performance reporting".
    We are using Unity 5.5.0f3 with Unity Pro.

    Also having NullReference with 300+ exceptions every day:

    Code (CSharp):
    1. MESSAGE
    2. NullReferenceException
    3.  
    4. STACK TRACE
    5. PresentsController.ShowWindow ()
    6. PresentsController.HandleShowResult (ShowResult result)
    7. UnityEngine.Advertisements.Advertisement+<Show>c__AnonStorey1.<>m__0 (System.Object sender, UnityEngine.Advertisements.FinishEventArgs e)
    8. UnityEngine.Advertisements.Android.Platform+<onUnityAdsFinish>c__AnonStorey3.<>m__0 (UnityEngine.Advertisements.CallbackExecutor executor)
    9. UnityEngine.Advertisements.CallbackExecutor.Update ()
    Would you recommend updating to last version of Unity?

    Thanks!
     
    Last edited: Apr 10, 2017
  8. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Hi everyone!

    Just making sure - have you updated to the most recent version of Unity Ads?

    SDK available here:
    - Asset Store package
    - Android SDK
    - iOS SDK

    Please let me know if updating resolves these fringe exceptions some of you seem to be experiencing.
     
  9. IceCatGames

    IceCatGames

    Joined:
    Mar 22, 2016
    Posts:
    33
    @mikaisomaa
    Finally, problem was solved after updating to last version of Unity Ads plugin. Thanks a lot for support.
     
  10. aprasad_zynga

    aprasad_zynga

    Joined:
    Jun 28, 2017
    Posts:
    1
    Hi, I am trying to integrate UnityAdsSdk2.1.0 from asset store. I am facing weird crash in iOS. Below is the stack trace

    Error::Unhandled Exception: System.ArgumentNullException: Value cannot be null.
    Parameter name: obj
    at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_monitor_enter (object)
    at UnityEngine.Advertisements.CallbackExecutor.Post (System.Action`1 ) <0x10142ec3c + 0x00037> in <filename unknown>:0
    at UnityEngine.Advertisements.iOS.Platform.UnityAdsDidStart (System.String ) <0x10142e5a4 + 0x000ab> in <filename unknown>:0
    at (wrapper native-to-managed) UnityEngine.Advertisements.iOS.Platform:UnityAdsDidStart (intptr)

    This crash is happening right after ads start in the game.
     
  11. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Hi,

    Can you provide some more details:
    - Your code responsible for handling Unity Ads
    - The iOS device model and iOS version
    - Does this reproduce each time?
    - Unity editor version


    You can also submit this information to unityads-support@unity3d.com and our engineers will inspect this closer.

    Feel free to share the entire project as well if possible.