Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug java.lang.NoSuchMethodError: No virtual method setRequestAgent(Ljava/lang/String;)Lcom/google/androi

Discussion in 'Unity Ads & User Acquisition' started by Bionics07, May 16, 2024.

  1. Bionics07

    Bionics07

    Joined:
    Dec 28, 2020
    Posts:
    5
    Hello! I'm facing this crash on my Google Play console for some players, but I can't reproduce it by myself.
    I'd like to know what could be the cause for this and a possible fix for it.
    As I can see it is happening in multiple devices and on multiple android versions.
    My game is running properly, just some players are getting this problem, and I couldn't find any answers yet.
    Here is the full log.


    Caused by: java.lang.NoSuchMethodError: No virtual method setRequestAgent(Ljava/lang/String;)Lcom/google/android/gms/ads/AdRequest$Builder; in class Lcom/google/android/gms/ads/AdRequest$Builder; or its super classes (declaration of 'com.google.android.gms.ads.AdRequest$Builder' appears in ---
    at com.unity3d.scar.adapter.v2100.requests.AdRequestFactory.getAdRequest (AdRequestFactory.java:17)
    at com.unity3d.scar.adapter.v2100.requests.AdRequestFactory.buildAdRequest (AdRequestFactory.java:22)
    at com.unity3d.scar.adapter.v2100.signals.SignalsCollector.getSCARSignal (SignalsCollector.java:22)
    at com.unity3d.scar.adapter.v2100.signals.SignalsCollector.getSCARSignalForHB (SignalsCollector.java:29)
    at com.unity3d.scar.adapter.common.signals.SignalsCollectorBase.getSCARBiddingSignals (SignalsCollectorBase.java:38)
    at com.unity3d.scar.adapter.common.ScarAdapterBase.getSCARBiddingSignals (ScarAdapterBase.java:28)
    at com.unity3d.services.ads.gmascar.GMAScarAdapterBridge.getSCARBiddingSignals (GMAScarAdapterBridge.java:121)
    at com.unity3d.services.ads.gmascar.GMA.getSCARBiddingSignals (GMA.java:56)
    at com.unity3d.services.ads.gmascar.managers.BiddingBaseManager.lambda$fetchSignals$1 (BiddingBaseManager.java:77)
    at java.lang.Thread.run (Thread.java:1012)
     
    n-dzhulabishvili likes this.
  2. Bionics07

    Bionics07

    Joined:
    Dec 28, 2020
    Posts:
    5
    I forgot to mention that I'm using AppLovin SDK to mediate ads.
     
  3. n-dzhulabishvili

    n-dzhulabishvili

    Joined:
    Jul 11, 2017
    Posts:
    3
    Hi! I encountered exactly the same problem. I found the cause in the incompatibility of the creative version (which was supplied by the ad network) and the current version of Unity ads. I updated all the mediation versions, released the builds, and everything got fixed. Also, temporarily disabling ads from the Unity networks helped.
     
  4. Bionics07

    Bionics07

    Joined:
    Dec 28, 2020
    Posts:
    5
    Thanks for the answer, I'm going to update my MaxSDK and the Unity ads adapter. I'm still not sure if it is going to fix because I didn't find any fix related to this on the changelog. If you can, I'd like to know which version of SDK you were using and what is the version that you have updated.
     
    n-dzhulabishvili likes this.
  5. n-dzhulabishvili

    n-dzhulabishvili

    Joined:
    Jul 11, 2017
    Posts:
    3
    You could see in your stack trace unity ads service. Same as I have.
    Code (CSharp):
    1. at com.unity3d.services.ads.gmascar.GMAScarAdapterBridge.getSCARBiddingSignals (GMAScarAdapterBridge.java:121)
    2. at com.unity3d.services.ads.gmascar.GMA.getSCARBiddingSignals (GMA.java:56)
    3. at com.unity3d.services.ads.gmascar.managers.BiddingBaseManager.lambda$fetchSignals$1 (BiddingBaseManager.java:77)
    My unity ads version:
    old: 4.9.2 --> new: 4.11.3

    You can also simply disable Unity ads for a while and check if the crashes disappear.
     
    Bionics07 likes this.
  6. Bionics07

    Bionics07

    Joined:
    Dec 28, 2020
    Posts:
    5
    Just an update here, I got an answer from unity ads support and they said that it is solved on Unity Ads SDK 4.10.0 version.
     
    n-dzhulabishvili likes this.
  7. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    146