Solved: Unity freezing when building First Scene for Android build

unity android broken build

How to cope with Unity bug around unable to generate Android build when the Compilation tool is staying forever on: “Compiling Scene1”? I’ve spent nearly 5 days by trying different things, but only one solution have sorted it for good. Here is my answer to this annoying problem.

Read moreSolved: Unity freezing when building First Scene for Android build

PHP 8.1 – Read-only class properties

barrier gate
barrier gate

To ensure the class property will never be modified/changed by itself or children or external calls we can now use a readonly prefix to class property declaration like so: public readonly string $propertyName = 'thisValueWillNeverChange;. The only place when we could override the readonly variable is inside the class constructor.

Read morePHP 8.1 – Read-only class properties

PHP 8.1 – Callable syntax

linked dots structure
linked dots structure

Convert any callable into Closure object to be returned and then used/called when needed. The next syntax (aka First class callable syntax) of $this->methodName(...) is identical in behavior as current: Closure::fromCallable([this, 'methodName']). Do not confuse this syntax to unpacking argument syntax of ...$args.

Read morePHP 8.1 – Callable syntax

PHP 8.1 – Default parameters with “new” keyword

abstract gradients
abstract gradients

Currently we could only assign a default parameter value of nullarray or primitive types in functions and methods. In PHP 8.1 we will be able to provide any custom class as default value for our expected function parameter. This includes defining a class variables inside the parameters as well.

Read morePHP 8.1 – Default parameters with “new” keyword

PHP 8.1 – Return types for internal methods

house internal
house internal

Every PHP internal methods from internal Classes will now contain a return type declarations. This change will impact any case of extending and overriding of internal PHP classes with custom implementations. From 8.1 we will get a deprecation and since 9.0 it will be a Fatal Error.

Read morePHP 8.1 – Return types for internal methods

PHP 8.1 – Deprecated Serializable interface

abstract clouds
abstract clouds

Since PHP 7.4 magic methods of __seralize() and __unserialize() were added, since then Serializable interfece is obsolete and in fact broken with new PHP 8.x features. This also includes deprecating of PDO::FETCH_SERIALIZE flag of PDO object that will be remove completely in PHP 9.

Read morePHP 8.1 – Deprecated Serializable interface