I have a public abstract class and I\'m trying to use the getClass()
method, as I will need info from the class extending my abstract class. An example is this:
This can happen if you have an Android project with Maven, and you import into IntelliJ using the Maven Android Platform
as the project SDK. The problem is that both Maven Android Platform
and the Android maven dependency jar includes the java.lang.Object
class.
The workaround is goint to Project structure -> Platform Settings -> SDK -> Maven Android Platform -> Classpath. It will list all the jars which are in JDK actually. Remove all of them, so only the two Android dependency remains (res
and annotations.jar
).
EDIT: This problem has been already reported to IntelliJ issue tracker long time ago.