Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug java.lang.VerifyError when displaying ads

Discussion in 'Unity Ads & User Acquisition' started by ebouchard88, Apr 28, 2022.

  1. ebouchard88

    ebouchard88

    Joined:
    Oct 22, 2017
    Posts:
    17
    I recently updated unity ads (Java implementation) to target Android 31 as well as using latest gradle tools

    Here is what I use now:
    PROP_COMPILE_SDK_VERSION=31
    PROP_MIN_SDK_VERSION=16
    PROP_TARGET_SDK_VERSION=31
    PROP_BUILD_TOOLS_VERSION=33.0.0

    classpath 'com.android.tools.build:gradle:7.1.3'
    classpath 'com.google.gms:google-services:4.3.10'

    Before it was:
    PROP_COMPILE_SDK_VERSION=30
    PROP_MIN_SDK_VERSION=16
    PROP_TARGET_SDK_VERSION=30
    PROP_BUILD_TOOLS_VERSION=30.0.3

    classpath 'com.android.tools.build:gradle:4.1.3'
    classpath 'com.google.gms:google-services:4.3.5'

    I changed a few more things here and there but I think one of these are probably the cause.

    Since then, I receive a lot of crash that was not there before (enough crash to go past the threshold easily) So I had to remove unity ads until I figure out what is happening. I was using Unity ads 3.7.5, I switch to 4.1 and I still have the same issue. I personally cannot reproduce the issue, I only see it with crash logs from production logs. This is what I receive:

    java.lang.VerifyError:
    at com.unity3d.services.ads.webplayer.WebPlayerView.<init> (WebPlayerView.java:98)
    at com.unity3d.services.ads.adunit.WebPlayerHandler.create (WebPlayerHandler.java:19)
    at com.unity3d.services.ads.adunit.WebPlayerHandler.onCreate (WebPlayerHandler.java:44)
    at com.unity3d.services.ads.adunit.AdUnitActivity.onCreate (AdUnitActivity.java:115)
    at android.app.Activity.performCreate (Activity.java:7893)
    at android.app.Activity.performCreate (Activity.java:7880)
    at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1306)
    at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3315)
    at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3489)
    at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:83)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2073)
    at android.os.Handler.dispatchMessage (Handler.java:107)
    at android.os.Looper.loop (Looper.java:225)
    at android.app.ActivityThread.main (ActivityThread.java:7563)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:539)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:994)

    Could not find anything on the internet regarding this. Does anyone have an idea?

    I validated the proguard and I have everything there. I let go HTTP in network_security_config (I was getting some warning there so I let the HTTP go to unity3d.com and unity3dusercontent.com). I see the issue on multiple devices using android 8.1 up to 11 (so far). I tested with the same devices that reported the issue on Google play console without repro success.

    By removing the "display ads code" the crash disappears (even though the loading, initialization etc is still there, so the issue seems to appear only on displaying ads).
     
    Last edited: Apr 28, 2022