Hey guys im getting this really weird error on and...
# android
w
Hey guys im getting this really weird error on android for my robotics team (FTC specifically) I am trying to call the invoke operator from the companion object in
Copy code
override val keys: Keys get() = GamePadKeysOld(gamepad = gamepad)
and it gives me a
Sealed types cannot be instantiated
error when building the android app I tried a small test case in a kotlin playground ( https://pl.kotl.in/8VWvKtOqm ) and set both versions to 1.4.30 and in the playground the error does not pop up and successfully runs Is there a reason for this and a way to fix? (I would like to keep it as an invoke call though just changing the function name is the solution I am currently using) Thanks in advance!
f
Do it the same way that coroutines are done. There is a MutableStateFlow class, and a MutableStateFlow() constructor function. Create a GamePadKeysOld() constructor function that will instantiate the right inner class.