firebase / firebase-unity-sdk

The Firebase SDK for Unity
http://firebase.google.com
Apache License 2.0
210 stars 35 forks source link

CommandInvokationFailure: Gradle build failed. #1067

Closed SanketAIT closed 1 month ago

SanketAIT commented 1 month ago

What is your question?

Error

CommandInvokationFailure: Gradle build failed. C:\Program Files\Unity\Hub\Editor\2022.3.37f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.3.37f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Please help.

Firebase Unity SDK Version

12.1.0

Unity editor version

2022.3.37f1

Installation Method

.unitypackage

Problematic Firebase Component(s)

No response

Other Firebase Component(s) in use

No response

Additional SDKs you are using

Admob, Play Games, In app review, OneSignal

Targeted Platform(s)

Android

Unity editor platform

Windows

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

google-oss-bot commented 1 month ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

argzdev commented 1 month ago

Hi @SanketAIT, this is most likely an issue with the Android Gradle Plugin. The most recent versions of Firebase SDK for Android have breaking changes:

Breaking change: Changed the required minimum compileSdkVersion to be 34 or higher. Breaking change: Updated minSdkVersion to API level 21 or higher.

It might be a compatibility issue. Could you try using Unity editor version 2022.3.38f1 and up. You may check out the Version compatibility chart in the official Unity documentations and use the specific Unity Editor version accordingly:

Unity version Gradle version Android Gradle Plug-in version
2022.3 (starting from 2022.3.38f1) 7.5.1 7.4.2
2022.3 (up and including 2022.3.37f1) 7.2 7.1.2
2021.32020.3 (starting from 2020.3.15f1) 6.1.1 4.0.1
2020.3 (up to and including 2020.3.14f1) 5.6.4 4.0.1

Let me know if this works, thanks!

SanketAIT commented 1 month ago

@argzdev Downloaded Unity 2023.2.20f1.

getting this error now. can you please check?

MY SETTINGS Screenshot 2024-07-16 224644

ERROR Screenshot 2024-07-16 224521

argzdev commented 1 month ago

Hey @SanketAIT, I'm not sure. Could you reach out to community forum in Unity, they will likely be able to assist you better with issues related to configuring your Unity editor. Other than that, this issue does not indicate any problem that's related to the Firebase SDK. Is there any reason why you suspect Firebase might be causing this issue?

SanketAIT commented 1 month ago

Hello @argzdev, I was previously using Firebase version 11.8.1, but after upgrading to version 12.1.0, I am encountering issues with building the .APK file. It seems that the upgrade may have introduced compatibility issues or conflicts affecting the build process. I will also be reaching out to the Unity community for further assistance with this issue.

Thank you very much for your help. :)

argzdev commented 1 month ago

No problem. That does sound like the upgrade issue is due to the breaking change. I'll go ahead and close this thread for now. Feel free to let me know if there's other underlying issues that come up after fixing the compatibility issue. We can always reopen the thread if we identify that Firebase SDK is causing the issue.