Update gradle plugin, catch NPE caused by some motorola devices when setting layer type