googleads / googleads-mobile-unity

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

error when building unexpected element <property> found in <manifest><application>. #2770

Closed RomainBitard closed 1 year ago

RomainBitard commented 1 year ago

[REQUIRED] Step 1: Describe your environment

Steps to reproduce:

I added the unityads adapter and when I build I get .gradle\caches\transforms-2\files-2.1\d7ed882264ea80439f05351530561451\com.unity3d.ads.unity-ads-4.7.0\AndroidManifest.xml:18:5-113: AAPT: error: unexpected element found in .

RomainBitard commented 1 year ago

it worked perfectly without the adapter, (banner, rewarded and interstitial ads from admob)

RomainBitard commented 1 year ago

When I look the androidmanifest that comes with the google unity plugin there is no property element image

NitroFuNyx commented 1 year ago

Have the same error....

RomainBitard commented 1 year ago

Have the same error.... Do you have the same problem on the sample project ? I'll try that later

NitroFuNyx commented 1 year ago

image Editor.log Hope it helps to solve a bit faster btw target API 30 (android) no custom grandles

RomainBitard commented 1 year ago

I tried with UnityAdsUnityAdapter-3.6.1 and it worked, there is a regression somewhere @NVentimiglia (excuse me if I tagged you improperly, tell me and it won't happen again :) )

RomainBitard commented 1 year ago

I don't know if it works yet because I don't see the unity ads adapter getting initialized unfortunately

amoswazana commented 1 year ago

Hey guys, we are running into the same issue when building for Android. It seems to have been resolved on Unity's end (see link: https://forum.unity.com/threads/android-build-fails-with-unity-ads-4-7-0.1433146/) In short: we need to update to version 4.7.1.

RomainBitard commented 1 year ago

Hey thanks a lot ! So we can't do anything yet except if someone patches it as it's open source !

On Thu, 15 Jun 2023, 10:32 amoswazana, @.***> wrote:

Hey guys, we are running into the same issue when building for Android. It seems to have been resolved on Unity's end (see link: https://forum.unity.com/threads/android-build-fails-with-unity-ads-4-7-0.1433146/ ) In short: we need to update to version 4.7.1.

— Reply to this email directly, view it on GitHub https://github.com/googleads/googleads-mobile-unity/issues/2770#issuecomment-1592605584, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKQOCUPZUM7JTEXQJ6MHFLXLLCCLANCNFSM6AAAAAAZGCP34M . You are receiving this because you authored the thread.Message ID: @.***>

amoswazana commented 1 year ago

@RomainBitard Yep, should be soon though. For now I have tested with Unity SDK 4.6.1 (Plugin version 3.6.1) and it seems to work.

NVentimiglia commented 1 year ago

@amoswazana

Thanks for the research! I will let the mediation folks know.

RomainBitard commented 1 year ago

What do you mean we need to update? Is there anything we can do ?

amoswazana commented 1 year ago

@RomainBitard By "we need to update to 4.7.1" I mean the Google Mobile Ads team needs to update the GoogleMobileAdsUnityAdsMediation.unitypackage file to point to the newest Unity Ads version. For now we can downgrade to version 3.6.1 of the unitypackage, it seems to work.

RomainBitard commented 1 year ago

That's what I understood but I wanted to make sure. I tried to implement admob sdk on another project and I have this issue even though I didn't use the unity adapter. third party libs are horrendous to integrate with unity as far as my experience goes oO

On Sun, 18 Jun 2023 at 09:43, amoswazana @.***> wrote:

@RomainBitard https://github.com/RomainBitard By "we need to update to 4.7.1" I mean the Google Mobile Ads team needs to update the GoogleMobileAdsUnityAdsMediation.unitypackage file to point to the newest Unity Ads version. For now we can downgrade to version 3.6.1 of the unitypackage, it seems to work.

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

RomainBitard commented 1 year ago

@RomainBitard By "we need to update to 4.7.1" I mean the Google Mobile Ads team needs to update the GoogleMobileAdsUnityAdsMediation.unitypackage file to point to the newest Unity Ads version. For now we can downgrade to version 3.6.1 of the unitypackage, it seems to work.

I used the latest unity adapter and changed the unity dependency to the 4.7.1 and it worked on my PC.

Dunno if my whole admob mediation is working though I don't have any adapter showing in the logs even though I call initStatus.getAdapterStatusMap(); Do you know what might be wrong ? I have 2 adapters in logs 1 KO one OK (even though I added 4+) com.google.ads.mediation.admob.AdMobAdapter Description: Failed to initialize adapter. com.google.ads.mediation.admob.AdMobAdapter does not implement the initialize() method. status : not ready. 2023/06/18 23:09:43.433 16615 16646 Info Unity Ads - AdsManager - Adapter: com.google.android.gms.ads.MobileAds status : ready

RomainBitard commented 1 year ago

@NVentimiglia @amoswazana any ideas ? I asked on google groups but no ones answered

xy2080 commented 1 year ago

哈喽,今天我遇到了同样的问题,已经解决啦 1、升级Unity Gradle到6.7.1版本 2、Assets-Plugin-Android-baseProjectTemplate.gradle文件,设置com.android.tools.build:gradle:4.2.1

ankittanwar456 commented 1 year ago

Thanks @xy2080. It also worked for me.

vincent-savysoda commented 1 year ago

I'm getting this issue with AudienceNetwork now

shahrukhhp1 commented 10 months ago

A bit late but still if anyone is trying to fix this issue, here's what you can do : Goto this file -> Assets\GoogleMobileAds\Editor\GoogleMobileAdsDependencies.xml and change androidPackage spec Change to: androidPackage spec="com.google.android.gms:play-services-ads:[22.3.0]"

Remember to keep version number in box parenthesis. After this I resolved my dependencies and build the game and it created apk successfully :)

fortunacio commented 10 months ago

Official doc: https://github.com/googleads/googleads-mobile-unity/releases

### Added Editor Options to enable removing the property tag from the Android Manifest of the GMA Android SDK. This is enabled by default for projects using Android Gradle Plugin version 4.2.1 and lower. GMA Android SDK 22.4.0 and above introduces a property tag in its Android Manifest that is not compatible with lower versions of Android Gradle Plugin (used by Unity 2022.1 and below).

I couldn't find the "editor option" so, for me, changing play-services-ads:22.6.0 to play-services-ads:22.3.0 works.

Also if you are using auto resolution for Android dependencies you must change this file: Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml with the correct version, otherwise the autoresolution gonna be overriding your downgrade.

Unity Version: 2021.3.19

valerieapps commented 10 months ago

Official doc: https://github.com/googleads/googleads-mobile-unity/releases

### Added Editor Options to enable removing the property tag from the Android Manifest of the GMA Android SDK. This is enabled by default for projects using Android Gradle Plugin version 4.2.1 and lower. GMA Android SDK 22.4.0 and above introduces a property tag in its Android Manifest that is not compatible with lower versions of Android Gradle Plugin (used by Unity 2022.1 and below).

I couldn't find the "editor option" so, for me, changing play-services-ads:22.6.0 to play-services-ads:22.3.0 works.

Also if you are using auto resolution for Android dependencies you must change this file: Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml with the correct version, otherwise the autoresolution gonna be overriding your downgrade.

Unity Version: 2021.3.19

Go to the menu bar > Assets > Google Mobile Ads > Settings.. You will see the option "Remove property tag from GMA" in the inspector with a check box. Check it and make sure your minimum API is 24 or higher. This will solve the problem without changing play srvices version.

vincent-savysoda commented 10 months ago

A bit late but still if anyone is trying to fix this issue, here's what you can do : Goto this file -> Assets\GoogleMobileAds\Editor\GoogleMobileAdsDependencies.xml and change androidPackage spec Change to: androidPackage spec="com.google.android.gms:play-services-ads:[22.3.0]"

Remember to keep version number in box parenthesis. After this I resolved my dependencies and build the game and it created apk successfully :)

Sadly I've already tried this but it still doesn't work for me. (This is with Audience Network mediation)

alexandrampolta commented 2 months ago

I fixed this by cordova platform remove android cordova platform add android and the Gradle issue was fixed , don't waste time updating Gradle if already is