Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Gradle build error related to environmental variables in Unity

I’m using Unity 2021.3.16f1 and when building for android I get gradle build errors like this:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':launcher:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':launcher:debugRuntimeClasspath'.
   > Could not find androidx.startup:startup-runtime:1.1.1..
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/startup/startup-runtime/1.1.1./startup-runtime-1.1.1..pom
       - https://jcenter.bintray.com/androidx/startup/startup-runtime/1.1.1./startup-runtime-1.1.1..pom
.
.
.

In the complete log unity prints out the environmental variabels and the path for the $PATH variable is wrong and is pointing out the an older version of Unity:

PATH = /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Unity/Hub/Editor/2019.4.13f1/PlaybackEngines/AndroidPlayer/SDK/platform-tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Unity/Hub/Editor/2021.3.9f1/PlaybackEngines/AndroidPlayer/SDK/platform-tools

Do I need to remove the redundant paths from this string?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Is this what it’s causing the gradle build error?

Here’s the complete log:
Gradle Build Failed

>Solution :

The error means Gradle could not resolve:

androidx.startup:startup-runtime:1.1.1.

note the the trailing . in the version: 1.1.1.

Change this to 1.1.1 and Gradle should be able to find the dependency and continue the build.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading