File -> Settings -> Compiler (Gradle-based Android Projects) Change the "VM options" to -Xmx512m -XX:MaxPermSize=512m