Unity Build Failed - WARNING: The option setting 'android.enableR8=false' is deprecated.

7,768 views
Skip to first unread message

Oblica Studio

unread,
Aug 27, 2022, 10:45:44 AM8/27/22
to Google Mobile Ads SDK Developers
I am just going mad with this build error. I have integrated Google Mobile Ads plugin. I have also integrated Google Mobile Ads Mediation for Unity Ads and Meta (Facebook). Everything was fine till then. I was able to build the project without any error. But then I have decided to add three more networks adapters (AdColony, AppLovin and InMobi). After that build has started throwing following error. I get the same build error even either of these. If I remove these three (keeping Unity Ads and Meta adapters), build works fine. I have tried many solutions mentioned on different forums, changed Gradle version even upgraded to Unity 2022, but as long as these three adapters are there, this build error is there. Please someone help me out.

--------------------------------------------------------------------------------------------------------------------------------------------

WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.3.38f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.3.38f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.3.38f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.3.38f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.3.38f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
...
> Task :launcher:processReleaseResources FAILED
> Task :launcher:bundleReleaseResources FAILED

---------------------------------------------------------------------------------------------------------------------------------------------
Error after above exception
---------------------------------------------------------------------------------------------------------------------------------------------

Note: ..\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
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\Sudeep Jain\.gradle\caches\transforms-2\files-2.1\f243f87f287fb4f4052bd069a9b71980\androidx.core.core-1.7.0\res\values\values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.
         
* 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:bundleReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\Sudeep Jain\.gradle\caches\transforms-2\files-2.1\f243f87f287fb4f4052bd069a9b71980\androidx.core.core-1.7.0\res\values\values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.
         
* 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 1m 19s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Oblica Studio

unread,
Aug 28, 2022, 11:51:27 PM8/28/22
to Google Mobile Ads SDK Developers
I have tried it on a fresh project with nothing but AdMob Mediation plugin for Unity and different adapters. The error is there as well. I have tried with adding single adapters and build as well as combinations of different adapters. I have tried with adding all adapters at once. Here is the results:

1. Only Unity Ads Adapter - It works, build successful.
2. Only Meta (Facebook) Ads Adapter - It works, build successful.
3. Only AdColony Adapter - It works, build successful.
4. Only AppLovin - Does not work. Build failed - Same Gradle error.
5. Only InMobi - Does not work. Build failed - Same Gradle error.
6. Unity Ads + Meta Adapters - It works, build successful.
7. Unity Ads + AdColony Adapters - Does not work. Build failed - Same Gradle error.
8. Meta + AdColony Adapters - It works, build successful.

So I think few adapters are not compatible with the Gradle version which Unity 2020 is using. But then I have changed Gradle version, downgrade and upgrade both, but still it didn't work. 

Oblica Studio

unread,
Aug 30, 2022, 1:23:15 AM8/30/22
to Google Mobile Ads SDK Developers
Really. Not a single reply from SDK team. Great. So you have developed a product and launched it without testing. You didn't bother to test if these adapters are working with each other, knowing if someone is using mediation then he will definitely have multiple adapters.  

Mobile Ads SDK Forum Advisor

unread,
Aug 30, 2022, 3:27:14 AM8/30/22
to oblica...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for thorough investigation on your concern.

For us to further investigate this, could you please provide the following details via Reply privately to author option or send it directly to the link below? 

  • Sample app project with all your implementation
  • Steps to replicate
  • SDK version used
  • Mediation Adapter version
  • Unity version

 If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002doJBqQAM&entry.80707362=00119295

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2doJBq:ref
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Tam Ibrahim

unread,
Sep 1, 2022, 10:41:52 AM9/1/22
to Google Mobile Ads SDK Developers
Did you fix it? Have the same issue

Mobile Ads SDK Forum Advisor

unread,
Sep 1, 2022, 6:45:15 PM9/1/22
to tami...@gmail.com, google-adm...@googlegroups.com

Hi Tam,

I have a workaround to issue:

- In Player Settings enable a Custom Main Gradle Template, a.k.a mainTemplate.gradle.
  - Open Build Settings
  - Open Player Settings (bottom left)
  - View Inspector
  - On the Android tab scroll to the bottom
  - Toggle 'Custom Main Gradle Template`
- Disable Jettyfier
  - `Unity Menu > Assets > External Dependency Manager > Settings`
  - Uncheck Use Minifier
  - `Unity Menu > Assets > External Dependency Manager > Force Resolve`

Hope this helps.

Nick



ref:_00D1U1174p._5004Q2doJBq:ref

Oblica Studio

unread,
Sep 1, 2022, 11:49:53 PM9/1/22
to Google Mobile Ads SDK Developers
This didn't work. In my case Minifier is unchecked. Also where to disable Jettyfier, I don't see any option. Also this is required by AndroidX, for AdMob mediation adapters.

Oblica Studio

unread,
Sep 4, 2022, 7:42:08 AM9/4/22
to Google Mobile Ads SDK Developers
Hello AdMob SDK Team,

Any update here. As per last communication, you were able to reproduce this issue following steps provided by me. I am quite sure many other developers are also facing same issue. All your adapter plugins are useless if they cannot work with each other. So please let us know a fix for this.

Mobile Ads SDK Forum Advisor

unread,
Sep 7, 2022, 8:11:39 PM9/7/22
to oblica...@gmail.com, google-adm...@googlegroups.com

Hi Oblica Studio,

 

We are still working on a longer term solution to this issue.

I have included the mainTemplate.gradle file Unity generated which enabled me to resolve android dependencies from the External Dependency Manager. I was able to resolve assets when I enabled this feature using default External Dependency Manager settings.

 

Thanks,

mainTemplate.gradle

Oblica Studio

unread,
Sep 8, 2022, 12:30:30 AM9/8/22
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
It didn't work. It didn't work when Unity Ads reference is there. Then I removed it and added AppLovin (implementation 'com.google.ads.mediation:applovin:11.4.4.0') reference. Then also it didn't work. It only works when there is references for Meta (Facebook) and AdColony. Only this combination is working.

Thanks.

Mobile Ads SDK Forum Advisor

unread,
Sep 8, 2022, 1:10:10 AM9/8/22
to sup...@oblica.in, google-adm...@googlegroups.com

Hi Oblica Studio,

 

We are working on a permanent fix. That said I have another work around for you on the additional cases.

Please add the following line to your gradleTemplate.properties file:
 

android.enableDexingArtifactTransform=false

This file can be added by enabling Build Menu > Player Settings > Android Settings > Custom Gradle Properties Template.

 

Hope this helps,

gradleTemplate.properties

Ali

unread,
Sep 13, 2022, 1:14:55 PM9/13/22
to Google Mobile Ads SDK Developers
I'm also facing same issue.

Also tried this android.enableDexingArtifactTransform=false
but did not work. 

Screenshot 2022-09-13 at 10.11.13 PM.pngScreenshot 2022-09-13 at 10.13.58 PM.png

Oblica Studio

unread,
Sep 14, 2022, 7:02:12 AM9/14/22
to Google Mobile Ads SDK Developers
Yeah,

I bet so many developers must facing this issue. But as usual AdMob SDK team is slow to investigate and respond. Though I come from .Net background and don't have knowledge about Java or Android programming, but it seems in some of their adapters they are still using android.enableR8 which is either deprecated or going to. Not sure why it must be so complex to fix and why they need all the time of world while we developers are suffering. 

I am quite surprised to see that Google has relied the development and support of it's one of the most crucial monetization platform (which probably every Android developer will use) to bunch of SDK guys and opensource. AdMob really sucks where most of the time SDK team fails to understand issue or respond too slow. I remember it was the same case case with AdMob plugin generating lots of ANRs and SDK team took almost one and half years to provide the fix. You can search this forum to find that issue. 

I believe same is going to happen with this issue as well. SDK team will just sit on it for a long time in excuse of providing a long term solutions.

I have tried to add other Ad networks which do not requires SDK, but they are utterly useless. Most of my partnership requests are still pending (after 15 days). Those who has approved it, do not returns any Ads, fill rates are almost zero. So it seems we indie developers will keep suffering because of this lousy AdMob plugins and adapters.

Mobile Ads SDK Forum Advisor

unread,
Sep 14, 2022, 12:03:53 PM9/14/22
to oblica...@gmail.com, google-adm...@googlegroups.com

Hi Oblica Studio,

 

I understand your frustration, and agree this is a serious problem.

 

I am actively working on this issue and want to resolve it in good time. It is a complex issue in that the root cause of the issue is not technically the SDK, but gradle and how package management works, specifically in respect to Unity and conflicting third party dependencies.

I want to thank you again for bringing this to the forefront, and will update you when we have resolution.

 

Thanks,

Oblica Studio

unread,
Sep 21, 2022, 2:01:30 AM9/21/22
to Google Mobile Ads SDK Developers
Hello,

Any update here? Do you able to identify and resolve the issue? When there would be an updated release?

As usual when I have started a Google Ads campaign for max install, Bloody AdMob has imposed the Ads serving limit again as my number of players have been increased and so the Ads requests. So in the absence of other providers in my mediation group, I am loosing revenue on daily basis. So I need to know what you are doing to fix this issue, and we developers will able to add other adapters/providers? 

Oblica Studio

unread,
Oct 4, 2022, 11:45:19 PM10/4/22
to Google Mobile Ads SDK Developers
So no update even after one and half month. I would like to know where you have registered this bug? Please provide us a link to Jira/Git or any other platform you use to log and track the SDK issue. We developers are impacting by this kind of issues and you cannot just say we are working on it. I would like to know the progress and timeline.

Oblica Studio

unread,
Dec 23, 2022, 11:57:28 PM12/23/22
to Google Mobile Ads SDK Developers
Any update here. This issue is not fixed even in the latest Mobile SDK (7.3.1). Are really working on it, because we are not able to use Mediation at all. Do you really care for developers or just sit on issues and let developers suffer. 

Mobile Ads SDK Forum Advisor

unread,
Mar 13, 2023, 2:03:29 PM3/13/23
to oblica...@gmail.com, google-adm...@googlegroups.com

Hi Oblica Studio,

 

We have good news. The bug which is blocking the incorporation of multiple adapters has been marked as fixed and will be included in the next release scheduled for next week.

 

- Nick



ref:_00D1U1174p._5004Q2doJBq:ref

Oblica Studio

unread,
Mar 15, 2023, 3:35:31 AM3/15/23
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
Thanks a lot. It would be a relief as I had to remove mediation from all of my games. I will test it on new release. It would be really helpful if you can let me know the release number so to make sure I am getting the fixed release.

Regards,
Oblica Studio

Reply all
Reply to author
Forward
0 new messages