Adding Android dependencies to Unity project
First, you need to add the repository where the Android library is hosted. Then you’ll add the dependency itself. Where to add the repository and dependency depends on which version of Unity you are using (Unity 2022.2 and newer, Unity 2020 - 2022.1, or Unity 2019).
The steps here generate Gradle files and then instruct you to add code snippets. If you already have custom Gradle files in your project, do not regenerate new files. Just copy the code snippets and add them to your custom Gradle files at the specified lines.
From the Edit menu, select Project Settings.