Unity "This project uses AndroidX dependencies" Error Solution

Unity "This project uses AndroidX dependencies" Error Solution

Unity "This project uses AndroidX dependencies" Error Solution

Unity "This project uses AndroidX dependencies" Error Solution


If you get a "Build failure" error when you try to get an output with Unity, and the explanation underneath is as in the visual above, you can use the solution method below to get your output without any problems.

First, in your project, under Build Settings;
Select and tick "Custom Main Gradle Template" and "Custom Gradle Properties Template".

Unity "This project uses AndroidX dependencies" Error Solution

After this operation, add the following codes into the "mainTemplate.properties" file.

# Android Resolver Properties Start
android.useAndroidX=true
android.enableJetifier=true
# Android Resolver Properties End

After you place the codes above, your codes should look like the following.

# Android Resolver Properties Start android.useAndroidX=true android.enableJetifier=true # Android Resolver Properties End

Now you can get your output without encountering this error.
By the way, if I need to mention, the main cause of this error is third-party plugins added externally, such as Google Admob.