How to Resolve Gradle Build Error: "The option setting 'android.enableR8=false' is deprecated..."

This article is specific for users getting the following error message or something very similar:

Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use
–status for details Configure project :launcher WARNING:: The option setting
‘android.enableR8=false’ is deprecated. It will be removed in version 7.0 of the
Android Gradle plugin. You will no longer be able to disable R8 Deprecated Gradle
features were used in this build, making it incompatible with Gradle 9.0

Note: ARDK no longer requires a custom Manifest, if you still have the box checked in the Publishing settings, make sure you uncheck it. The Manifest is now automatically filled in at build time.

Step 1: Check the Custom Base Gradle Template

The first thing to check is your Custom Base Gradle Template. It’s a common source of error to put in the version of Gradle being used instead of the Android Gradle Plugin version. These versions are NOT the same thing. The plugin version should read 4.2.0 like in the image below.

Try to build your project and if the error goes away after this change and your build is successful, there’s no need to follow the rest of this article. If you’re still getting the same (or similar) error, try the next step.

Step 2: If you’re using a Gradle version higher than 6.7.1, change it back to 6.7.1

This error also tends to come up when attempting to use versions of Gradle that are higher than the recommended 6.7.1. Currently, the latest version of Unity that ARDK supports is 2021.3. If you’re using 2022 or newer, the Gradle version will be higher than 6.7.1 and may also cause build errors. The easiest way to resolve this error is to use the Gradle version outlined in our Android guide, v6.7.1, which is sufficient for the purpose of building with ARDK.

Build your project and if the error still hasn’t gone away please reach out to us on our Community Forums or Discord Community for further assistance. Likewise, if you need a higher version of Gradle and it keeps throwing this error, reach out to us as well along with the specific reason (such as features) for why you need the higher version and we will provide assistance though can’t guarantee compatibility.

I have followed both of the steps but still getting the same error.

  • Unity Version : 2021.3.27f1
  • ARDK : 2.5.2
  • Device type & OS version: Android
  • Host machine & OS version: Windows
  • Issue Environment : On Device

Build error:

I made a custom .gradle file in my project as described here… Unity - Manual: Gradle templates , default base gradle version is 4.0.1
so I edited that text to read 4.2.0,
Do I need to do more than just changing the text?

…then from instructions here… Gradle | Releases I installed gradle 6.7.1… (plus setting up the path in unity settings ) but still get build errors, with empty project only containing ARSDK, MapSDK and samples.

" if you still have the box checked in the Publishing settings, make sure you uncheck it."
Where is this setting please ?

  • windows 2010 home, Unity 2022.1.14f1 from 3D-URP base project.

  • Examples2.5.2, ARDK 2.5.2, mapsSDK 0.4.0

  • Problem is when → Building to Android target ( it runs fine in editor )

  • This is with both an empty project (just lightship SDKs), and an existing project I tried to convert from unity ARkit to Lightship, same issues.

Note:- another issue to watch out for, the tar package unzips with all read-only files… this borks up your project.

many of the build compile errors ( not all ) look like this. is read-only really the issue? editing file properties does not work, they stay read only. " Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.1.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only"

Hi @Jonnathan_Hilliard

The only thing that should be edited is the version. I would recommend following our article on building for Android to make sure you have everything set up.

The part where I note that you have to uncheck the custom Manifest can be found in Edit → Project Settings → Player and scroll down to Publishing. In Publishing, under Build, only the Custom Base Gradle Template should be checked which is the 5th box. The Custom Main Manifest which is the first box should be UNCHECKED. It used to be that it needed to be checked and manually edited but that is no longer the case; so make sure that is unchecked. If you still require further assistance please open a topic in our community forum for further assistance.

For the Maps tar issue, can you please create a separate topic in the community forums to address that separately from the Android build issue?

Thank you for your assistance. Yes that is exactly how I have it setup, but without any success.