googleads / googleads-mobile-unity

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

AdMob 7.1.0 & AppLovin 6.3.0 -> Crash on Android (Exoplayer) #2091

Closed dcosmin-97 closed 1 year ago

dcosmin-97 commented 2 years ago

Environment:

Problem: -> If you try to watch an ad from AppLovin, it will crash the app

Has anyone faced this issue and found a solution? Thank you!

dcosmin-97 commented 2 years ago

Current AndroidResolver, maybe there is something missing:

<package>com.android.support:appcompat-v7:24.0.+</package>
<package>com.android.support:support-v4:26.1.+</package>
<package>com.google.ads.mediation:adcolony:4.7.0.0</package>
<package>com.google.ads.mediation:applovin:11.3.3.0</package>
<package>com.google.ads.mediation:facebook:6.10.0.0</package>
<package>com.google.ads.mediation:unity:4.2.1.0</package>
<package>com.google.android.gms:play-services-ads:21.0.0</package>
<package>com.google.android.gms:play-services-base:18.0.1</package>
<package>com.google.android.play:core:1.8.+</package>
<package>com.google.firebase:firebase-analytics:21.0.0</package>
<package>com.google.firebase:firebase-analytics-unity:9.1.0</package>
<package>com.google.firebase:firebase-app-unity:9.1.0</package>
<package>com.google.firebase:firebase-common:20.1.1</package>
<package>com.unity3d.ads:unity-ads:4.2.1</package>

<file>Assets/Plugins/Android/androidx.annotation.annotation-1.3.0.jar</file>
<file>Assets/Plugins/Android/androidx.annotation.annotation-experimental-1.1.0.aar</file>
<file>Assets/Plugins/Android/androidx.appcompat.appcompat-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.arch.core.core-common-2.1.0.jar</file>
<file>Assets/Plugins/Android/androidx.arch.core.core-runtime-2.1.0.aar</file>
<file>Assets/Plugins/Android/androidx.asynclayoutinflater.asynclayoutinflater-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.browser.browser-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.collection.collection-1.1.0.jar</file>
<file>Assets/Plugins/Android/androidx.coordinatorlayout.coordinatorlayout-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.core.core-1.6.0.aar</file>
<file>Assets/Plugins/Android/androidx.cursoradapter.cursoradapter-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.customview.customview-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.documentfile.documentfile-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.drawerlayout.drawerlayout-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.fragment.fragment-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.interpolator.interpolator-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.legacy.legacy-support-core-ui-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.legacy.legacy-support-core-utils-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.legacy.legacy-support-v4-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-common-2.1.0.jar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-livedata-2.1.0.aar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-livedata-core-2.1.0.aar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-runtime-2.1.0.aar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-service-2.1.0.aar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-viewmodel-2.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.loader.loader-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.localbroadcastmanager.localbroadcastmanager-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.media.media-1.3.1.aar</file>
<file>Assets/Plugins/Android/androidx.print.print-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.recyclerview.recyclerview-1.2.1.aar</file>
<file>Assets/Plugins/Android/androidx.room.room-common-2.2.5.jar</file>
<file>Assets/Plugins/Android/androidx.room.room-runtime-2.2.5.aar</file>
<file>Assets/Plugins/Android/androidx.slidingpanelayout.slidingpanelayout-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.sqlite.sqlite-2.1.0.aar</file>
<file>Assets/Plugins/Android/androidx.sqlite.sqlite-framework-2.1.0.aar</file>
<file>Assets/Plugins/Android/androidx.startup.startup-runtime-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.swiperefreshlayout.swiperefreshlayout-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.tracing.tracing-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.vectordrawable.vectordrawable-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.vectordrawable.vectordrawable-animated-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.versionedparcelable.versionedparcelable-1.1.1.aar</file>
<file>Assets/Plugins/Android/androidx.viewpager.viewpager-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.work.work-runtime-2.7.0.aar</file>
<file>Assets/Plugins/Android/com.adcolony.sdk-4.7.1.aar</file>
<file>Assets/Plugins/Android/com.applovin.applovin-sdk-11.4.2.aar</file>
<file>Assets/Plugins/Android/com.facebook.android.audience-network-sdk-6.11.0.aar</file>
<file>Assets/Plugins/Android/com.google.ads.mediation.adcolony-4.7.1.1.aar</file>
<file>Assets/Plugins/Android/com.google.ads.mediation.applovin-11.4.2.0.aar</file>
<file>Assets/Plugins/Android/com.google.ads.mediation.facebook-6.11.0.1.aar</file>
<file>Assets/Plugins/Android/com.google.ads.mediation.unity-4.2.1.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-common-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-core-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-dash-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-extractor-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-hls-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-rtsp-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-smoothstreaming-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-transformer-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-ui-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-ads-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-ads-base-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-ads-identifier-18.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-ads-lite-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-appset-16.0.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-base-18.0.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-basement-18.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-api-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-base-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-impl-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-sdk-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-sdk-api-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-stats-17.0.2.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-tasks-18.0.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.play.core-1.8.3.aar</file>
<file>Assets/Plugins/Android/com.google.android.ump.user-messaging-platform-2.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.firebase.firebase-analytics-21.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.firebase.firebase-analytics-unity-9.1.0.aar</file>
<file>Assets/Plugins/Android/com.google.firebase.firebase-annotations-16.0.0.jar</file>
<file>Assets/Plugins/Android/com.google.firebase.firebase-app-unity-9.1.0.aar</file>
<file>Assets/Plugins/Android/com.google.firebase.firebase-common-20.1.1.aar</file>
<file>Assets/Plugins/Android/com.google.firebase.firebase-components-17.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.firebase.firebase-installations-17.0.1.aar</file>
<file>Assets/Plugins/Android/com.google.firebase.firebase-installations-interop-17.0.1.aar</file>
<file>Assets/Plugins/Android/com.google.firebase.firebase-measurement-connector-19.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.guava.failureaccess-1.0.1.jar</file>
<file>Assets/Plugins/Android/com.google.guava.guava-27.1-android.jar</file>
<file>Assets/Plugins/Android/com.google.guava.listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar</file>
<file>Assets/Plugins/Android/com.unity3d.ads.unity-ads-4.2.1.aar</file>
<file>Assets/Plugins/Android/org.jetbrains.annotations-13.0.jar</file>
<file>Assets/Plugins/Android/org.jetbrains.kotlin.kotlin-stdlib-1.5.31.jar</file>
<file>Assets/Plugins/Android/org.jetbrains.kotlin.kotlin-stdlib-common-1.5.31.jar</file>
NVentimiglia commented 2 years ago

@dcosmin-97 Can you submit the error / exception message?

dcosmin-97 commented 2 years ago

@dcosmin-97 Can you submit the error / exception message?

I think the adapter needs update for Google Mobile Ads SDK version 21.0.0.

Will come back with all the details.

dcosmin-97 commented 2 years ago

I have updated to the following:

Unity version: 2020.3.36f1
Google Mobile Ads Unity plugin version: 7.1.0
Platform: Android
Platform OS version: 12
Mediation ad networks used, and their versions:
-> AdColony 2.5.0
-> AppLovin 6.3.0
-> Facebook 3.7.0
-> Unity 3.2.1
Other SDK : Firebase 9.1.0
External Dependency Manager: 1.2.171

The crash is still present when I try to watch an ad from AppLovin. Here you can see the logs: crash_1

Here is everything related to exoplayer in my Android Dependencies Manifest:

<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-common-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-core-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-dash-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-extractor-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-hls-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-rtsp-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-smoothstreaming-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-transformer-2.15.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.exoplayer.exoplayer-ui-2.15.1.aar</file>

Is there any temporary workaround? Thank you!

Rickard87 commented 2 years ago

@dcosmin-97 please tag me if you find a workaround. Exoplayer3 issue is making me anxious

tongledi commented 2 years ago

I have the same problem

dcosmin-97 commented 2 years ago

@Rickard87 @tongledi I found a solution on the internet and it is working for me:

Go to Project Settings -> Player -> Publishing Settings and enable Custom Gradle Properties Template After ADDITIONAL_PROPERTIES line, add the following:

android.enableDexingArtifactTransform=false

I don't know if this will affect anything else, but for the moment it is working.

Rickard87 commented 2 years ago

@dcosmin-97 Thank you! I will try this out tomorrow

PokerDawg commented 2 years ago

This solution does seem to work for us, when viewing AppLovin ads through the mediation test suite. Without it, the ads would load, but trying to view them would crash the game.

android.enableDexingArtifactTransform=false

I'd still be cool if this was fixed by default in a future version of this plugin.

Rickard87 commented 2 years ago

@dcosmin-97 that seems to work for me thank you @PokerDawg really? I don't have any crashes from it

PokerDawg commented 2 years ago

@Rickard87 Yes, in the mediation test suite, without the solution above, AppLovin ads would always load, but would crash the game when trying to watch them with the same error @dcosmin-97 posted in his screenshot.

Rickard87 commented 2 years ago

@PokerDawg oh yes I understand. Since you are using Applovin mediation. Would you mind walking me through the setup? Bidding works but Waterfall doesn't. ("Can't retrieve data"). At your convenience of course

PokerDawg commented 2 years ago

@Rickard87 We're not using waterfall ads, only bidding.

I'm also using UnityAds, IronSource and Facebook mediation, but I don't think it's relevant here. Just set up the AdMob plugin like usual, make sure it work fine in a build, import all the mediation plugins and the mediation test suite, force resolve, build again. At this point for us, AppLovin ads (bidding) load, but crash the game when opening. If I add the line into the Custom Gradle Properties, force resolve, and build again, AppLovin ads (bidding) open without issues.

dhamelin commented 1 year ago

@Rickard87 @tongledi I found a solution on the internet and it is working for me:

Go to Project Settings -> Player -> Publishing Settings and enable Custom Gradle Properties Template After ADDITIONAL_PROPERTIES line, add the following:

android.enableDexingArtifactTransform=false

I don't know if this will affect anything else, but for the moment it is working.

I was using this patch, but it doesn't seem to be compatible with the latest Google Mobile Ads Unity plugin (v.7.3.1)

I'm having this error at compiling time: java.lang.NoClassDefFoundError: com/android/tools/lint/client/api/Vendor_

So I had to removed the patch, but according to this post: https://stackoverflow.com/a/61573110/3046594, the issue should have been fixed if we are using a more recent version of Gradle.

NVentimiglia commented 1 year ago

We are still looking into these issues.

b/270634126 for reference.

DoryRyu commented 1 year ago

@NVentimiglia How to get into the reference b/270634126? (I am new to github)

NVentimiglia commented 1 year ago

Hi @DoryRyu this is an internal reference. We are working on the issue, let us know if you have additional details or findings.

DoryRyu commented 1 year ago

Hi, Nicholas.

I am so glad to hear it's fixed. Is there any necessary update from my side? Such as the version update of google ads.

Thanks in advance.

2023년 3월 17일 (금) 오전 10:05, Nicholas Ventimiglia @.***>님이 작성:

Closed #2091 https://github.com/googleads/googleads-mobile-unity/issues/2091 as completed.

— Reply to this email directly, view it on GitHub https://github.com/googleads/googleads-mobile-unity/issues/2091#event-8773305791, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6C7DTPXHQR5LR2GP6NPKS3W4O2GFANCNFSM5YXEFR7A . You are receiving this because you were mentioned.Message ID: @.*** .com>