Skip to content

AndroidX dependencies are not automatically added in Unity 2020.1 with the Firebase 6.16.0 SDK when using a mainTemplate.gradle #810

@patm1987

Description

@patm1987

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.1.6f1
  • Firebase Unity SDK version: 6.16.0
  • Source you installed the SDK: Unity Package Manager (.unitypackage or Unity Package Manager)
  • Problematic Firebase Component: Database (Auth, Database, etc.)
  • Other Firebase Components in use: Database (Auth, Database, etc.)
  • Additional SDKs you are using: none (Facebook, AdMob, etc.)
  • Platform you are using the Unity editor on: Mac (Mac, Windows, or Linux)
  • Platform you are targeting: Android (iOS, Android, and/or desktop)
  • Scripting Runtime: Mono (Mono, and/or IL2CPP)

[REQUIRED] Please describe the issue here:

When building a Firebase project (in this case, the Database test app) with a mainTemplate.gradle, I get the following issue:

> This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

It will go away if I also generate a gradleTemplate.properties file with android.useAndroidX=true in it or if I delete the mainTemplate.gradle file.

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

Steps to reproduce:

  1. Check out one of the test apps (I used the Database one).
  2. Add a mainTemplate.gradle file
    image
    Restart Unity (you may get a resolution failed error if you don't perform this step)
  3. Click "Build And Run" for Android

Android Resolver Settings:
image

Workaround (if you need a mainTemplate.gradle file, it works fine without one):

  1. Also generate a gradleTemplate.properties file:
    image
  2. Add android.useAndroidX=true to the end of it. Note that just generating this file is not enough, but it must be modified as well.

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
What's the issue repro rate? 100%

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

// TODO(you): code here to reproduce the problem

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions