Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

play-services-ads:22.4.0 issue #2930

Closed
dcosmin-97 opened this issue Sep 14, 2023 · 39 comments
Closed

play-services-ads:22.4.0 issue #2930

dcosmin-97 opened this issue Sep 14, 2023 · 39 comments
Assignees
Labels
P1 Priority issue.

Comments

@dcosmin-97
Copy link

dcosmin-97 commented Sep 14, 2023

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2021.3.30f1
  • Google Mobile Ads Unity plugin version: 8.5.2
  • Platform: Android - Unity Editor
  • Mediation ad networks used, and their versions: Applovin 6.9.0, Liftoff 4.0.0, Meta 3.11.0, Mintegral 1.2.1, Pangle 2.3.0

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

If you force resolve, you will get
Assets/Plugins/Android/com.google.android.gms.play-services-ads-22.4.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-ads-base-22.4.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-ads-identifier-18.0.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-ads-lite-22.4.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-appset-16.0.1.aar
Assets/Plugins/Android/com.google.android.gms.play-services-base-18.2.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-basement-18.1.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-measurement-21.3.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-measurement-api-21.3.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-measurement-base-21.3.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-measurement-impl-21.3.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-measurement-sdk-21.3.0.aar
Assets/Plugins/Android/com.google.android.gms.play-services-measurement-sdk-api-21.3.0.aar

The resolve will complete without errors.

The issue when you try to build:
FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\Admin\.gradle\caches\transforms-2\files-2.1\00277a26865588baf0041d38a0cce91f\com.google.android.gms.play-services-ads-lite-22.4.0\AndroidManifest.xml:48:5-117: AAPT: error: unexpected element <property> found in <manifest><application>.

How to fix:
Assets\GoogleMobileAds\Editor\GoogleMobileAdsDependencies.xml
Change to:
androidPackage spec="com.google.android.gms:play-services-ads:[22.3.0]"

@NVentimiglia
Copy link
Member

Hi @dcosmin-97

Confirmed the issue, thank you.

@NVentimiglia NVentimiglia self-assigned this Sep 15, 2023
@NVentimiglia NVentimiglia added P1 Priority issue. P2 Issue. and removed P1 Priority issue. labels Sep 15, 2023
@xmx77
Copy link

xmx77 commented Sep 17, 2023

Not work with me, untiy Unity version: 2021.3.29.
I try to change to :com.google.android.gms:play-services-ads:[22.3.0]
And to com.google.android.gms:play-services-ads:[22.4.0]
both of them not work.

@dcosmin-97
Copy link
Author

Not work with me, untiy Unity version: 2021.3.29. I try to change to :com.google.android.gms:play-services-ads:[22.3.0] And to com.google.android.gms:play-services-ads:[22.4.0] both of them not work.

I can try to help you, what other SDK and mediations do you have in the game?
Also, delete all the resolved libraries and check for the remaining ones to exist in the main AndroidManifest.xml.

@xmx77
Copy link

xmx77 commented Sep 17, 2023

Not work with me, untiy Unity version: 2021.3.29. I try to change to :com.google.android.gms:play-services-ads:[22.3.0] And to com.google.android.gms:play-services-ads:[22.4.0] both of them not work.

I can try to help you, what other SDK and mediations do you have in the game? Also, delete all the resolved libraries and check for the remaining ones to exist in the main AndroidManifest.xml.

Unity version: 2021.3.30f1
Google Mobile Ads Unity plugin version: v8.5.2
Platform: Android - Unity Editor

I have those SDKs :

  • Firebase sdk
  • facebook SDK
  • Unity ADS

And the issue it was
`Execution failed for task ':launcher:processReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/Users/dddddd/.gradle/caches/transforms-2/files-2.1/b786d6b8050a9adf09aae2d746c9c69e/com.google.android.gms.play-services-ads-lite-22.4.0/AndroidManifest.xml:48:5-117: AAPT: error: unexpected element found in .`

@dcosmin-97
Copy link
Author

Not work with me, untiy Unity version: 2021.3.29. I try to change to :com.google.android.gms:play-services-ads:[22.3.0] And to com.google.android.gms:play-services-ads:[22.4.0] both of them not work.

I can try to help you, what other SDK and mediations do you have in the game? Also, delete all the resolved libraries and check for the remaining ones to exist in the main AndroidManifest.xml.

Unity version: 2021.3.30f1 Google Mobile Ads Unity plugin version: v8.5.2 Platform: Android - Unity Editor

I have those SDKs :

* Firebase sdk

* facebook SDK

* Unity ADS

And the issue it was `Execution failed for task ':launcher:processReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/Users/dddddd/.gradle/caches/transforms-2/files-2.1/b786d6b8050a9adf09aae2d746c9c69e/com.google.android.gms.play-services-ads-lite-22.4.0/AndroidManifest.xml:48:5-117: AAPT: error: unexpected element found in .`

Well, I know that Unity ADS has some issues when you resolve. I have opened a separate issue for it.
If you set this to "com.google.android.gms:play-services-ads:[22.3.0]", you should not have com.google.android.gms.play-services-ads-lite-22.4.0
Make sure everything is deleted when you press delete resolved, it may have issues

@xmx77
Copy link

xmx77 commented Sep 17, 2023

Not work with me, untiy Unity version: 2021.3.29. I try to change to :com.google.android.gms:play-services-ads:[22.3.0] And to com.google.android.gms:play-services-ads:[22.4.0] both of them not work.

I can try to help you, what other SDK and mediations do you have in the game? Also, delete all the resolved libraries and check for the remaining ones to exist in the main AndroidManifest.xml.

Unity version: 2021.3.30f1 Google Mobile Ads Unity plugin version: v8.5.2 Platform: Android - Unity Editor
I have those SDKs :

* Firebase sdk

* facebook SDK

* Unity ADS

And the issue it was `Execution failed for task ':launcher:processReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/Users/dddddd/.gradle/caches/transforms-2/files-2.1/b786d6b8050a9adf09aae2d746c9c69e/com.google.android.gms.play-services-ads-lite-22.4.0/AndroidManifest.xml:48:5-117: AAPT: error: unexpected element found in .`

Well, I know that Unity ADS has some issues when you resolve. I have opened a separate issue for it. If you set this to "com.google.android.gms:play-services-ads:[22.3.0]", you should not have com.google.android.gms.play-services-ads-lite-22.4.0 Make sure everything is deleted when you press delete resolved, it may have issues

ok it's work ,
I don't understand you mean change "com.google.android.gms:play-services-ads:[22.3.0]" with Brackets
i just change like this "com.google.android.gms:play-services-ads:22.3.0"

Anyway thank you for help

@NVentimiglia
Copy link
Member

Glad it is working, we are still looking into this issue.

@GodzillaDev
Copy link

GodzillaDev commented Sep 19, 2023

Hi @NVentimiglia @dcosmin-97, I'm facing this issue as well, however after deleting the suggested libraries, in the error logs we still see the following error:
21:21:09 1: Task failed with an exception. 21:21:09 ----------- 21:21:09 * What went wrong: 21:21:09 Execution failed for task ':launcher:processReleaseResources'. 21:21:09 > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade 21:21:09 > Android resource linking failed 21:21:09 C:\Users\dev\.gradle\caches\transforms-3\2d9222cb9\transformed\jetified-com.google.android.gms.play-services-ads-lite-22.4.0\AndroidManifest.xml:48:5-117: AAPT: error: unexpected element <property> found in <manifest><application>. 21:21:09 21:21:09 21:21:09 * Try: 21:21:09 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. 21:21:09 ============================================================================== 21:21:09

21:21:09 2: Task failed with an exception. 21:21:09 ----------- 21:21:09 * What went wrong: 21:21:09 Execution failed for task ':launcher:bundleReleaseResources'. 21:21:09 > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade 21:21:09 > Android resource linking failed 21:21:09 C:\workspace\Temp\gradleOut\launcher\build\intermediates\bundle_manifest\release\bundle-manifest\AndroidManifest.xml:532: AAPT: error: unexpected element <property> found in <manifest><application>.

Could it have something to do with other sdks depending on that specific version of play-services-ads-lite-22.4.0? E.g AppsFlyer forcing it to revert to that version of play-services?

@qbit86
Copy link

qbit86 commented Sep 21, 2023

@NVentimiglia > Confirmed the issue
@NVentimiglia > we are still looking into this issue.

I'm also facing this AAPT failure after updating AppLovin mediation adapters in Unity project.
image

Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /Users/…/AndroidManifest.xml:622: AAPT: error: unexpected element <property> found in <manifest><application>.

We are using Gradle 6.5 with Gradle plugin 4.1.0:

classpath 'com.android.tools.build:gradle:4.1.0'

Minimum SDK version (API level): 22
Target SDK version (API level): 33

Please let us know when you fix this!

@BlackDemonZyT
Copy link

BlackDemonZyT commented Sep 21, 2023

I have the same issue also, help please, this is important issue basically you cannot integrate Google Admob in any Unity App

[pram:03.512][err] * What went wrong: [pram:03.512][err] Execution failed for task ':launcher:processDebugResources'. [pram:03.512][err] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade [pram:03.512][err] > Android resource linking failed [pram:03.512][err] C:\Users\black\.gradle\caches\transforms-2\files-2.1\057b562dece9137b8f32755026740bcc\com.google.android.gms.play-services-ads-lite-22.4.0\AndroidManifest.xml:48:5-117: AAPT: error: unexpected element <property> found in <manifest><application>.

@NVentimiglia
Copy link
Member

Thanks for the update, we are still looking into this issue and hope to solve this soon.

@dcosmin-97
Copy link
Author

Thanks for the update, we are still looking into this issue and hope to solve this soon.

Hello!
Is there an ETA for this and Unity Ads fixes? We cannot integrate them properly.
Thank you!

@NVentimiglia NVentimiglia added P1 Priority issue. and removed P2 Issue. labels Sep 29, 2023
@NVentimiglia
Copy link
Member

No ETA at the moment, but I have flagged this issue as high priority.

@dcosmin-97
Copy link
Author

Changes to androidPackage spec="com.google.android.gms:play-services-ads:[22.3.0]" does not work anymore.
Has anyone find a temporary fix for this?

@chakaramba
Copy link

chakaramba commented Oct 4, 2023

We're using Applovin MAX plugin for unity, version 5.1.4
And recently, after updating Google AdMob integration from android_22.0.0.2_ios_10.4.0.0 to android_22.4.0.0_ios_10.11.0.0 (alongside with other mediations, but that seem to not matter), we've encountered issue with android builds failing with the following log:

Execution failed for task ':launcher:processReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
%path%/jetified-facebook-core-16.2.0/AndroidManifest.xml:36:13-37: AAPT: error: unexpected element <property> found in <manifest><application>.

Note: iOS builds were fine.

After a quite painful investigation through sdk and mediations changelogs and testing different changes on their own, it appeared that updating Google ads mediation network was the cause. After that, we've found this issue about the latest 22.4.0 release for Android Google ads and corresponding 22.4.0.0 update for Google Ads Android mediation in Applovin MAX.

So, as a workaround to preserve latest changes in iOS mediation and still have near-to-latest changes on Android, we've manually edited corresponding mediation dependencies file Assets/MaxSdk/Mediation/Google/Editor/Dependencies.xml to have latest version iOS pod and android package specified as [22.3.0.0]:

<androidPackage spec="com.applovin.mediation:google-adapter:[22.3.0.0]" />
<iosPod name="AppLovinMediationGoogleAdapter" version="10.11.0.0" />

Useful links:

@dcosmin-97
Copy link
Author

We're using Applovin MAX plugin for unity, version 5.1.4 And recently, after updating Google AdMob integration from android_22.0.0.2_ios_10.4.0.0 to android_22.4.0.0_ios_10.11.0.0 (alongside with other mediations, but that seem to not matter), we've encountered issue with android builds failing with the following log:

Execution failed for task ':launcher:processReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
%path%/jetified-facebook-core-16.2.0/AndroidManifest.xml:36:13-37: AAPT: error: unexpected element <property> found in <manifest><application>.

Note: iOS builds were fine.

After a quite painful investigation through sdk and mediations changelogs and testing different changes on their own, it appeared that updating Google ads mediation network was the cause. After that, we've found this issue about the latest 22.4.0 release for Android Google ads and corresponding 22.4.0.0 update for Google Ads Android mediation in Applovin MAX.

So, as a workaround to preserve latest changes in iOS mediation and still have near-to-latest changes on Android, we've manually edited corresponding mediation dependencies file Assets/MaxSdk/Mediation/Google/Editor/Dependencies.xml to have latest version iOS pod and android package specified as [22.3.0.0]:

<androidPackage spec="com.applovin.mediation:google-adapter:[22.3.0.0]" />
<iosPod name="AppLovinMediationGoogleAdapter" version="10.11.0.0" />

Useful links:

* Mediation changelog: [iOS](https://github.com/AppLovin/AppLovin-MAX-SDK-iOS/blob/master/Google/CHANGELOG.md)/[Android](https://github.com/AppLovin/AppLovin-MAX-SDK-Android/blob/master/Google/CHANGELOG.md)

* SDK changelog: [iOS](https://developers.google.com/admob/ios/rel-notes)/[Android](https://developers.google.com/admob/android/rel-notes)

Have you tried a different Gradle / Gradle plugin other than the default one from Unity? I think this might be the cause.
I will try this approach today.

@chakaramba
Copy link

Have you tried a different Gradle / Gradle plugin other than the default one from Unity? I think this might be the cause.
I will try this approach today.

@dcosmin-97, no, just skipped the "broken" 22.4.0 version by sticking to the previous 22.3.0 until the fix will come

@nathandotjpeg
Copy link

@chakaramba I spent all day looking at this and this is the solution that worked! Thank you! I wish I had found it hours ago 😅

@ivancy2001
Copy link

ivancy2001 commented Oct 6, 2023

hi, the following works for me with Unity 2021.3.27f1, AppLovin sdk version 11.11.3, Admob mediation version 22.4.0 / Admob sdk version 8.5.2

  1. upgrading unity gradle to 6.7.1
  2. under Assets/Plugin/Android/baseProjectTemplate.gradle - set dependencies classpath: com.android.tools.build:gradle:4.2.1

@BrushkouMatvey
Copy link

hi, the following works for me with Unity 2021.3.27f1, AppLovin sdk version 11.11.3, Admob mediation version 22.4.0 / Admob sdk version 8.5.2

  1. upgrading unity gradle to 6.7.1
  2. under Assets/Plugin/Android/baseProjectTemplate.gradle - set dependencies classpath: com.android.tools.build:gradle:4.2.1

how to update unity Gradle to 6.7.1?

@BrushkouMatvey
Copy link

Have you tried a different Gradle / Gradle plugin other than the default one from Unity? I think this might be the cause.
I will try this approach today.

@dcosmin-97, no, just skipped the "broken" 22.4.0 version by sticking to the previous 22.3.0 until the fix will come

what is the version of AppLovin MAX SDK?

@chakaramba
Copy link

@BrushkouMatvey, MAX SDK v11.11.3, same as it was for Plugin v 5.11.3
image

Though, this version is still off the changelog for whatever the reason :/
https://github.com/AppLovin/AppLovin-MAX-Unity-Plugin/releases

copybara-service bot pushed a commit that referenced this issue Oct 27, 2023
@ericleich
Copy link
Member

We published some documentation at https://developers.google.com/admob/unity/gradle with details on how to upgrade Gradle. For folks still having issues, we'd appreciate feedback on whether these steps work for you.

@SCastanedaMunoz
Copy link

SCastanedaMunoz commented Nov 2, 2023

We published some documentation at https://developers.google.com/admob/unity/gradle with details on how to upgrade Gradle. For folks still having issues, we'd appreciate feedback on whether these steps work for you.

Hey, I have noticed the documentation fix states that this should be applied when using target API 33 or higher, this seems incorrect as you should be able to build without issues when targeting API 33. (I have corroborated this with older Unity versions such as 2020.3.37f1).

Is this fix/requirement something that will be required for future versions, let's say 22.5.0? 🤔

The proposed fix also does not seem compatible with 2020.3.37f1, following the steps proposed on the document we keep encountering the same set of issues.

From our end we have documented on a video all the require steps to Export as an Android Studio project and upgrade to Gradle higher versions (tested with 8.1.2), using the AGP Upgrade tool. This seems to be the only way to build for API 34 on 2020.3+.

For quick reference, we implement GMA through native adapters for our Unity Mediation SDK. 😓

@batteredhedgehog
Copy link

why is this closed? Pinning a dependency is a workaround, not a fix.

copybara-service bot pushed a commit that referenced this issue Nov 13, 2023
copybara-service bot pushed a commit that referenced this issue Nov 13, 2023
copybara-service bot pushed a commit that referenced this issue Nov 13, 2023
copybara-service bot pushed a commit that referenced this issue Nov 14, 2023
copybara-service bot pushed a commit that referenced this issue Nov 14, 2023
copybara-service bot pushed a commit that referenced this issue Nov 15, 2023
copybara-service bot pushed a commit that referenced this issue Nov 16, 2023
copybara-service bot pushed a commit that referenced this issue Nov 16, 2023
@NVentimiglia
Copy link
Member

Hello everyone,

We have launched v8.6.0 of the Google Mobile Ads for Unity Plugin. This is an important patch release that resolves compatibility issues between older AGP version 4.0.1(Unity editors below 2022.3) and Android GMA SDKv 22.4 and above.

Previously, we have published this workaround instructing you on how to upgrade Unity's Gradle installation. While this option is still recommended, this additional step is no longer required with and after v8.6.0 of the Plugin

In Google Mobile Ads Settings you will see two new options; "Enable kotlix.coroutines packaging options." and "Remove property tag from GMA Android SDK.". Make sure both of these options are enabled and your build should work as expected.

image

Lastly, if you see any issues with this release, please report the problem here, and I will be happy to help you out.

Nick

@thanhtoan88
Copy link

WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.3.1) was tested up to compileSdk = 33

This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties

@kushG
Copy link

kushG commented Nov 29, 2023

Hey @NVentimiglia I'm running into this #3042. Any insights ?

@NVentimiglia NVentimiglia reopened this Dec 15, 2023
@shefich
Copy link

shefich commented Dec 15, 2023

I used gradle 6.7.1 and custom baseProjectTemplate as described in the workaround.
It gives me error upon build:
A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable See the Console for details.
In console:
Execution failed for task ':launcher:bundleReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable
AAPT2 aapt2-4.2.0-7147631-windows Daemon #0: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
How can I fix this?

@NVentimiglia
Copy link
Member

Another work around is to use EDM4U dependency resolution instead of Custom Main Gradle Template and
Custom Gradle Properties Template. We are looking into a solution.

@shefich
Copy link

shefich commented Dec 15, 2023

I'm using custom templates in my project cause of other libraries. Also I use EDM4U and update resolution every time after adding new sdk. But I still have the error described above.
Unity 2021.3.33
Google Mobile Ads Unity Plugin v8.6.0

@shefich
Copy link

shefich commented Dec 15, 2023

BTW it works in Unity 2022.3.x (building for Android SDK 34 with Admob 8.6.0)

@NVentimiglia
Copy link
Member

Closing this issue as fixed.

Please feel free to open a new issue if you run into gradle problems.

@shefich
Copy link

shefich commented Jan 12, 2024

It doesn't fixed. I tried it now and still have this error upon build on Unity 2021.3.34:
`FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':launcher:bundleReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable
AAPT2 aapt2-4.2.1-7147631-windows Daemon #0: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    ==============================================================================

2: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':launcher:processReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
AAPT2 aapt2-4.2.1-7147631-windows Daemon #1: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    ==============================================================================
  • Get more help at https://help.gradle.org
    BUILD FAILED in 41s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)`

@DungDajHjep
Copy link

hi, the following works for me with Unity 2021.3.27f1, AppLovin sdk version 11.11.3, Admob mediation version 22.4.0 / Admob sdk version 8.5.2

  1. upgrading unity gradle to 6.7.1
  2. under Assets/Plugin/Android/baseProjectTemplate.gradle - set dependencies classpath: com.android.tools.build:gradle:4.2.1

Thanks so much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Priority issue.
Projects
None yet
Development

No branches or pull requests