Search Unity

Resolved Android build fails with Unity Ads 4.7.0

Discussion in 'Unity Ads & User Acquisition' started by adrianpbarnstorm, May 5, 2023.

  1. adrianpbarnstorm

    adrianpbarnstorm

    Joined:
    Jan 10, 2022
    Posts:
    4
    Our game was building successfully for Android a week ago but is now failing. The Unity Ads package is pulled in automatically by the external dependency resolver and the problem appears to be due to a change going from 4.6.1 to 4.7.0. This is the error:

    It built fine with 4.6.1.

    Looking at the diff between 4.6.1 and 4.7.0, a property element has been added:

    Looking at the documentation for the property element https://developer.android.com/guide/topics/manifest/property-element, it was added in API level 31. As the build tools Unity uses are 30.0.2 (Unity 2021.3 LTS), I'm wondering if this is the issue?
     
    Last edited: May 5, 2023
    rbitard likes this.
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Are you using mediation or only using Unity Ads SDK? Which tool do you use to integrate Unity Ads, Android Studio or Unity Editor?
     
  3. adrianpbarnstorm

    adrianpbarnstorm

    Joined:
    Jan 10, 2022
    Posts:
    4
    We're using Advertisement with Mediation 1.0.5. Integration is using Unity Editor (2021.3.16f1), with the default SDKs/tools it installs.
     
  4. adrianpbarnstorm

    adrianpbarnstorm

    Joined:
    Jan 10, 2022
    Posts:
    4
    I see now 4.7.1 has been released and can confirm that that fixes the build issue.
     
    roointan and SamOYUnity3D like this.
  5. securegames123

    securegames123

    Joined:
    Jun 30, 2020
    Posts:
    12
  6. adrianpbarnstorm

    adrianpbarnstorm

    Joined:
    Jan 10, 2022
    Posts:
    4
    Looks like they haven't released an update that pulls in 4.7.1. We're using Unity's Advertisement with Mediation and the External Dependency Manager pulled in the new version for us.
     
    securegames123 likes this.
  7. securegames123

    securegames123

    Joined:
    Jun 30, 2020
    Posts:
    12
    Anyway I used older version, unity adapter 3.6.0 works for me now
     
  8. roointan

    roointan

    Joined:
    Jan 8, 2018
    Posts:
    78
    Thanks! a combination of this, and using target API 33 worked for me.
     
  9. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    still the same to me, using unity levelplay (I'll switch soon it's horrendous, keep bugging, low fill rates)
     
  10. benjamin_thegoodevil

    benjamin_thegoodevil

    Joined:
    Aug 5, 2020
    Posts:
    20
    Had the same problem.

    In the Unity Ads version 4.7.0 they introduced something which required a higher gradle version than the one unity is currently using (at least the one which unity 2021.3 is using). You have to upgrade to 4.7.1 in order to fix this problem.

    https://docs.unity.com/ads/en-us/manual/Changelog

    If you are using the Google Mobile Ads Plugin with Unity mediation locate the 'UnityMediationDependencies.xml' in your project and open it.

    Here change:


    <androidPackage spec="com.google.ads.mediation:unity:4.7.0.0">
    =>
    <androidPackage spec="com.google.ads.mediation:unity:4.7.1.0">

    And also


    <androidPackage spec="com.unity3d.ads:unity-ads:4.7.0">
    =>
    <androidPackage spec="com.unity3d.ads:unity-ads:4.7.1">
     
    james580 likes this.
  11. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    Good to know thanks, I just changed the unity-ads to 4.7.1 and it builded correctly. I'll change the mediation one too !
     
  12. usamasubaiyyal52

    usamasubaiyyal52

    Joined:
    Jan 6, 2023
    Posts:
    1
    bro how i can solve this issue i am using admob ads with meta mediation
     
  13. omar_5

    omar_5

    Joined:
    Feb 8, 2020
    Posts:
    9
    For me I've downgraded Admob adapter version found Assets\MaxSdk\Mediation\Google\Editor
    from
    <androidPackage spec="com.applovin.mediation:google-adapter:[22.5.0.0]" />
    to
    <androidPackage spec="com.applovin.mediation:google-adapter:[19.1.0.0]" />
     
    pchelozyk_unity likes this.
  14. pchelozyk_unity

    pchelozyk_unity

    Joined:
    Aug 19, 2019
    Posts:
    1
    Thx. This solved my error