- Home /
Android builds all failing now, I don't think I changed anything? What's "R8"?
So I've been successfully doing debug (non-signed) android builds for months. Using all the default settings, using whatever sdk/jdk/ndk is install with unity (v 2020.3.11). All of the sudden, they stopped working with the following error:
Starting a Gradle Daemon, 1 incompatible and 6 stopped Daemons could not be reused, use --status for details
Configure project :launcher
WARNING: The option 'android.enableR8' is deprecated and should not be used anymore. It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
Additionally, an error or 2 later I get this, and I'm not sure if its related or a different issue.
stderr[ Note: C:\path\to\project\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 failed with an exception. ...
I tried checking the Minify > R8 checkbox. I also tried generating custom gradle files and removing the lines referring to R8, but this just led to a different kind of broken build. I'm not using any android packages like ads or analytics, which seem to be the majority of posts about this issue. It almost seems like the android build tools updated themselves randomly and broke, but that's not a thing, is it?
I've even rolled my git repo back to when builds were still working fine, and they don't build there either, so I don't think it's something I did. Should I just uninstall/reinstall the android tools? Or try doing a full project rebuild (that'll take hours, which is why I haven't tried yet)?
It seems like something internally got screwed up and if anyone could point me to where I can fix it, I'd very much appreciate it!
Answer by callen · Aug 27, 2021 at 09:28 PM
The steps followed in this post fixed it for me. https://forum.unity.com/threads/gradle-build-fail-with-adressables.975969/#post-7037542
1, Edit -> Player Setting -> Publishing Settings, click "Custom Base Gradle Template" blew the Build section.
2, You will find a "Assets\Plugins\Android\baseProjectTemplate.gradle" file was generated, open it by text editor.
3, change "classpath 'com.android.tools.build:gradle:3.6.0'" into "classpath 'com.android.tools.build:gradle:3.4.0'"
Build again, and don't forget to add it to your CVS.