Added gen directory to sourceDirectories in pom.xml, but excluded the BuildConfig and R classes.