<Gradle build failed> Solution. Unity 2022.3.14~3.15 || licenses problem

 

When encountering the message:


Checking the license for package Android SDK Platform 33 in C:\Program Files\Unity\Hub\Editor\2022.3.15f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\licenses



and noticing that the `licenses` folder was not present in the specified Unity SDK path, you explored the Android Studio SDK path at:

C:\Users\User\AppData\Local\Android\Sdk\licenses


Assuming that this folder was created when installing Android Studio, you copied the contents from the Android Studio SDK `licenses` folder and pasted them into the Unity Editor's SDK path. This action was taken in an attempt to resolve licensing issues, as it is believed that licenses are necessary for obtaining required components.

Until now, attempts were made to address the issue under the assumption that the SDK would fetch dependencies automatically if proper permissions were granted (e.g., attempting to modify permissions in Windows Explorer by right-clicking on folders, going to properties, and removing read-only status). However, these attempts did not yield successful results.

After copying the `licenses` folder from the Android Studio SDK to the Unity Editor's SDK path, the build process was executed again, and this time, the build completed successfully. The hypothesis was that licenses are essential for acquiring necessary components, and by providing them manually, the build process could proceed without issues.

 

 

 

 

After completing the build, a new directory, `android-33`, was observed within the `platforms` folder located at:

C:\Program Files\Unity\Hub\Editor\2022.3.15f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms



This directory was not present before the build. It appears that this directory houses components that needed to be 

installed but were missing due to licensing issues.

While the exact reason for the licenses not being generated remains unclear, it is evident that the absence of licenses led to the described issue. Despite efforts such as reformatting the computer, reinstalling the Unity engine, and attempting various solutions, the problem persisted throughout most of the day. Ultimately, the issue was resolved.

For anyone facing a similar problem where Gradle build fails during the build process, resulting in the mentioned error 

messages, this information may be helpful.

  Comments,     Trackbacks