Solvedkoin java.lang.NoSuchMethodError: No virtual method elapsedNow-UwyO8pc()D in class Lkotlin/time/TimeMark

ligi
454

Describe the bug

After updating to Kotlin 1.5.0 I am getting this runtime error:

04-27 15:37:54.756  6429  6429 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method elapsedNow-UwyO8pc()D in class Lkotlin/time/TimeMark; or its super classes (declaration of 'kotlin.time.TimeMark' appears in /data/app/org.walleth-rBcMmS3wfGt-FnuS1dhI1g==/base.apk)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at org.koin.core.time.MeasureKt.measureDuration(Measure.kt:63)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at org.koin.core.KoinApplication.modules(KoinApplication.kt:63)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at org.walleth.App$onCreate$1.invoke(App.kt:142)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at org.walleth.App$onCreate$1.invoke(App.kt:139)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at org.koin.core.context.GlobalContext.startKoin(GlobalContext.kt:65)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at org.koin.core.context.DefaultContextExtKt.startKoin(DefaultContextExt.kt:31)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at org.walleth.App.onCreate(App.kt:139)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1182)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at android.app.ActivityThread.access$1300(ActivityThread.java:219)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:107)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:214)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7356)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
04-27 15:37:54.756  6429  6429 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

happens with koin 3.0.1

20 Answers

βœ”οΈAccepted Answer

As a temp workaround you should set your KoinApplication.logger() to Level.ERROR or Level.NONE.
Or just do not configure logger at all.

Other Answers:

I believe this is critical as more and more people will jump in 1.5.0 kotlin

Deployment done for 3.0.2 & 2.2.3 πŸŽ‰

Is there any workaround when I'm not using Koin directly in my Android app but when it's one of my dependencies that uses Koin? It seems like the default log level is set to Info for Android applications.

More Issues: