Why can I not force resolve successfully with Android and Firebase?

I am getting this error when I do force resolve for android:


FAILURE: Build failed with an exception.

What went wrong: Could not create an instance of type org.gradle.initialization.DefaultSettings_Decorated.
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org

The Android Force Resolve can fail for a number of possible reason so I’d recommend enabling verbose logging and running Force Resolve again.

  1. In Assets > External Dependency Manager > Android Resolver > Settings, enable Verbose Logging"
  2. Run Force Resolve again. You will get more detailed information about the steps it took and when/where it may have failed.
  3. Try addressing the new information
  4. Run Force Resolve again.
  5. If the cause is ambiguous or non-obvious, try navigating to Unity >Preferences >External Tools and toggling each of these checkboxes to their opposite value and back. Oftentimes, this type of error occurs because Unity is ignoring external tool settings and toggling them forces Unity to reload the setting.
  6. Run Force Resolve again.
  7. See if the log displays anything new. If it succeeds, congrats, if it fails investigate the new logs and repeat.

More information and context available in the Level Up with Firebase Build and Debug Guide