Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity build systems: internal vs gradle

Tags:

unity3d

I cannot find anywhere what are the differences between internal and gradle. (I can find info about gradle, but unfortunately not about internal)

Can someone write pros and cons and which one is better to use, or it depends on app you are creating?

like image 337
sswwqqaa Avatar asked Oct 17 '17 20:10

sswwqqaa


People also ask

What is Gradle build Unity?

Gradle is an Android build system that automates a number of build processes and prevents many common build errors. In Unity, Gradle reduces the method reference count in DEX (Dalvik Executable format) files, which means you are less likely to come across DEX limit problems. Unity uses Gradle for all Android builds.

What is build system in Unity?

In software engineering, a unity build (also known as unified build or jumbo build) is a method used in C and C++ software development to speed up the compilation of projects by combining multiple translation units into a single one, usually achieved by using include directives to bundle multiple source files into one ...

What is inside Gradle build?

Every Gradle build is composed of at least one project (e.g. a library JAR, a Java application, a web application). Each project is made up of one or more tasks. A task represents some atomic piece of work that a build performs.

How do I migrate to using the Gradle build system?

Import a Gradle-based IntelliJ project If you are already using Gradle with your IntelliJ project, you can open it in Android Studio using the following steps: Click File > New > Import Project. Select your IntelliJ project directory, and click OK. Your project will open in Android Studio.


Video Answer


3 Answers

The Internal(Default) is used to build and even run your Unity Project on Android from the Editor. This can be done with the Build And Run button.


The Gradle(New) option gives you extra option to export your Unity project into Android Studio project if the Export Project option is checked. The Export Project option can only be checked when Gradle(New) is selected. Gradle(New) option is mostly useful for the Android platform only.

Another advantage of Gradle(New) is that it allows you to specify your own gradle file to build your Unity Project. Just name the gradle file "mainTemplate.gradle" and put it in the <ProjectName>Assets\Plugins\Android directory.

In the old days, to use gradle file in your build, you must export the Unity Project as Android Project then use a third party software like Android Studio or Eclipse to add gradle support to your app. The Gradle(New) made that easier. You can now do that without exporting the project at-all with the Gradle(New) option.

like image 194
Programmer Avatar answered Oct 18 '22 05:10

Programmer


Gradle is build system which automates a number of build processes. This automation means that many common build errors are less likely to occur. Most notably in Unity, it reduces the method reference count in DEX (Dalvik Executable format) files, meaning that you are less likely to come across DEX limit problems. However, due to the differences between Gradle and the default Unity Android build system, some existing projects may be hard to convert to Gradle.

You can either build the output package (APK) using the Gradle build system in Unity, or export the Gradle project and build it in an external tool (such as Android Studio).

To learn more, see Gradle’s resources on Getting Started with Gradle for Android Build. Internal Build is old system that used by unity technology to build the apk file The Internal build system creates an APK by invoking Android SDK utilities in a specific order. Unity automatically performs a number of steps to create the APK, including:

  • Preparing and building the Unity Assets
  • Compiling scripts
  • Processing the plug-ins
  • Splitting the resources into the parts that go to the APK and the OBB, if Split Application Binary is selected
  • Building the Android resources using the AAPT utility
  • Generating the Android manifest and merging the library manifests into it
  • Compiling the Java code into the Dalvik Executable format (DEX)
  • Building the IL2CPP library, if IL2CPP Scripting Backend is selected
  • Building and optimizing the APK and OBB packages

For more information about OBB files, see Unity documentation on OBB Support. For more information about the Android Manifest, see Unity Android Manifest documentation.

like image 30
Muhammad_08 Avatar answered Oct 18 '22 05:10

Muhammad_08


One recent and very major difference since Unity 2019.1.0b1 is that the internal build system is no longer supported!

Android: Remove internal build system

like image 5
Ruzihm Avatar answered Oct 18 '22 05:10

Ruzihm