Adding lifecycle events to build.gradle