I’ve recently started seeing a NoSuchMethodError w...
# android
l
I’ve recently started seeing a NoSuchMethodError when calling an expect contructor. It seems to be looking for a method
Int$class-Foo()I
, when I call the constructor
expect class Foo(s: String, i1: Int, i2: Int)
. It seems to be looking at a
LiveLiterals$FooKt
class, but not sure where this LiveLiterals is coming from. When I check the APK, I see the
LiveLiterals$FooKt
class, and it has a similar method (
Int$class-Foo()
). Not sure what’s going on.
When I change the name of Foo to Bar, I get the same issue, but with LiveLiterals$Bar.
c
A wild guess would be you've started using a new version of Android Studio whilst working on a jetpack compose project and as it has support for updating an application that is running, it's attempting to build in support for the IPC between the IDE and the running app, but you don't have the up-to-date dependencies available in your debug classpath when the app is running. If you can, I'd check to make sure you have all the required dependencies (especially
debugImplementation
dependencies) setup and make sure they are up-to-date.
l
I disabled live update in settings, and it’s still having the same issue. Oddly, Foo is not used in or referenced by any composable.
I had a global method in the same file as the expect class. Removing it seems to fix this.