1

So as the title says I've updated Android studio to the next canary version, after that all of Jetpack Compose projects throw this error after launching:

java.lang.AbstractMethodError: abstract method "void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)"

Mohamed Ibrahim
  • 3,714
  • 2
  • 22
  • 44

2 Answers2

1

Answering my question after upgrading Android gradle plugin version to 7.0.0-rc01 things works normally now. so the solution is to replace

classpath("com.android.tools.build:gradle:7.1.0-alpha04")

With

classpath("com.android.tools.build:gradle:7.0.0-rc01")

Also, There was a suggestion for incrementing minSdk to 24 but didn't try it.

Mohamed Ibrahim
  • 3,714
  • 2
  • 22
  • 44
0

Most probably you implement in your code DefaultLifecycleObserver and not override all the interface methods. It is very important to override ALL methods and remove super calls from them.