When you come across the getClass() error, go to the declaration of the method (⌘B on Mac). This will navigate to $ANDROID_HOME/sources/android-DD/java/lang/Object.java. From within IntelliJ, make the following edit which removes the unbounded wildcard:
// Removed unbounded wildcard (Class<?>) to avoid http://youtrack.jetbrains.com/issue/IDEA-72835 public final native Class getClass();
(If you do this from within IntelliJ, you may be prompted to remove the Read-Only flag from the Object.java file.)
reference: http://stackoverflow.com/questions/18505973/android-studio-ambiguous-method-call-getclass