Android app crash after starting video ad

G

giedrius

Guest
Hi everyone.

I'm having this issue with video ads on some android devices. I have tested it on multiple devices and recently published at google play store. Soon after i found out that it crashes on some devices after attempt to play video ad ( specifically on s7 and s8 so far ). Hardly believe there is something with the code.

Tried both VM and YYC - same result ( btw i noticed different behaviour on YYC in swtch statement ).
Runtime: 2.2.1.287
Armv7, Arm64
Build tools 28.0.0
Using unityads ( linked to app )

On play console i get this crash report for every single crash:

java.lang.RuntimeException:

at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2955)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3030)
at android.app.ActivityThread.-wrap11 (Unknown Source)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1696)
at android.os.Handler.dispatchMessage (Handler.java:105)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6938)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

Help needed.

Also, this is my first project and i would love to hear enything from you about it.
https://play.google.com/store/apps/details?id=com.aronbit.block_rider

Thanks.
 
G

giedrius

Guest
UPDATE:

Seems like this crash happens only on android 8.0...
 

Andrey

Member
I have the same problem.
At this point, I just closed the ads for Android 8.0
 
Last edited:

Andrey

Member
The solution for me was to replace the inclusion of Inject to AndroidManifest in the extension. Old removed and new added:

Code:
<activity android:name="com.unity3d.ads.adunit.AdUnitActivity"
android:excludeFromRecents="true"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" />

<activity android:name="com.unity3d.ads.adunit.AdUnitSoftwareActivity"
android:excludeFromRecents="true"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" />
 
S

Starpolygon

Guest
The solution for me was to replace the inclusion of Inject to AndroidManifest in the extension. Old removed and new added:

Code:
<activity android:name="com.unity3d.ads.adunit.AdUnitActivity"
android:excludeFromRecents="true"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" />

<activity android:name="com.unity3d.ads.adunit.AdUnitSoftwareActivity"
android:excludeFromRecents="true"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" />
Hello Andrey,

Cool that you found a solution. Where do i find the injection to manifest by the unity ads extension? Not sure where i can modify it.
Thanks and cheers
 
S

Scizor

Guest
I had the same issue of ads crashing on Android 8.0 when updating to API 28.

Just wanted to say that the solution Andrey posted worked for me.

Seems the issue was caused by having "Theme.Translucent.NoTitleBar.Fullscreen", i removed the "Translucent" part from both of the "android:theme" sections and put "Theme.NoTitleBar.Fullscreen" instead and Unity Ads started working again!
 
Top