Cannot inherit from final class error

与世无争的帅哥 提交于 2019-11-28 12:11:40

if you're using kotlin, add open to your class (extends RealmObject) declaration

The message means what it says.

Somewhere, somehow you have managed to create a class that extends a superclass, where the superclass has been declared as final.

The most likely cause is that you have a conflict between your build classpath and your launch classpath. In other words, you are compiling your subclass against a version of the superclass that is not final, and then running against a version that is final. The verifier is saying (correctly) that this is wrong.


If it is not your build / one of your classes that is causing this, then it is some internal conflict within the CouchDB client classes that you are using. Indeed the fact that this is a VerifyError rather than an IncompatibleClassChangeError suggests that this maybe a problem with some dynamically generated bytecodes.

I also faced this with IntelliJ Idea: 2018.3 Community Edition, However running following fixed it for me:

mvn -U idea:idea clean compile install -DskipTests
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!