Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Gradle in Unity

Since I want to add Firebase to my Android Game I want to include Google Auth. But I have the following Problem. I need to add some Code to the build.gradle File but I cant find it in my Unity Project.

Here is the manual I found from Firebase : https://firebase.google.com/docs/auth/android/google-signin

I searched on all my Drives for build.gradle but found nothing. Can you tell me where I find it or what do I have to do to implement the Code from the Link?

like image 752
Rene Ungerer Avatar asked Dec 08 '17 10:12

Rene Ungerer


People also ask

How do I open Gradle in unity?

Double-click the mainTemplate. gradle file in the Project view to open it in an external text editor. By default, Unity uses the settingsTemplate. gradle file from the Unity install directory to create the settings.

How do I use Gradle?

Create a project for C++ language files. Add a C++ source file and header. Use Gradle to generate a command-line application. Run the application and view the results, along with the output of the compiler and linker.


1 Answers

To use Gradle in Unity.

1.Go to <UnityInstallationDirecory>\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates, then copy mainTemplate.gradle file to your <ProjectName>Assets\Plugins\Android folder.

2.You can then modify mainTemplate.gradle to be whatever you want it to be. Now, to make sure the build uses the gradle file, change the Build System to "Gradle (New)".

enter image description here

like image 180
Programmer Avatar answered Nov 03 '22 00:11

Programmer