```abstract class ComposeAbstractTest { @Compo...
# compose
b
Copy code
abstract class ComposeAbstractTest {
    @Composable
    abstract fun createView()
}

class ComposeTest: ComposeAbstractTest {
    @Composable
    fun createView() {
        Column { }
    }
}
Hi is such a thing possible? I'm getting a runtime error with my provided example and my understanding of Compose it seems like this shouldn't be possible.
a
Do you mean the
ComposeTest
extends
ComposeAbstractTest
?
b
Right
a
Can you paste the error? This is how
ComposeView
is implemented so it's definitely intended to work 🙂
b
Top of the stack trace
Copy code
java.lang.NoSuchMethodError: No virtual method createView(Landroidx/compose/runtime/Composer;I)V in class Ldev/birdsofparadise/mua/lifecycle/ComposeView; or its super classes (declaration of 'dev.birdsofparadise.mua.lifecycle.ComposeView' appears in /data/data/dev.birdsofparadise.notestand.app.androidApp/code_cache/.overlay/base.apk/classes5.dex)
        at dev.birdsofparadise.mua.lifecycle.ComposeActivityKt$addComposableViewRoute$1.invoke(ComposeActivity.kt:59)
Usage:
Copy code
val platformInterface = createComposeView()
    if (platformInterface is ComposeView) {
        platformInterface.createView()
    } else {
        throw Error("TODO")
    }
So the issue steams from casting it somehow because
Copy code
val platformInterface = ComposeTest()
platformInterface.createView()
works
Copy code
val platformInterface = createComposeView() as ComposeTest
platformInterface.createView()
works
a
Interesting. Can you open an issue on the tracker with the repro? We'll have a look
a
arent you supposed to add the override keyword?
b
ya sorry its just pseudo code
I'm not able to reproduce it in a clean project, which leads me to believe it might not directly relate to Compose. I'll keep looking into it
b
Whoa
from the grave lol
It might be 🤷 its been awhile sorry
c
No worries. I think I am hitting the exact issue with Compose 1.0.3
Trying with 1.0.4 and 1.1.0-alpha
b
oh good luck!
lemme know if it works
c
It is not addressed in the latest versions, I will file an issue regarding this stacktrace - I think it is slightly different from the two issues mentioned above
Looks like it is actually not a problem for Compose in my case, I just forgot to have
android.buildFeatures.compose true
in the module hosting the base abstract class.