koin: java.lang.NoSuchMethodError: No virtual method elapsedNow-UwyO8pc()D in class Lkotlin/time/TimeMark
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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 48
- Comments: 19 (8 by maintainers)
Commits related to this issue
- Application crash fix * https://github.com/InsertKoinIO/koin/issues/1076 — committed to liujoshua/AssessmentModel-KotlinNative by liujoshua 3 years ago
- Update Koin to 2.2.3 and disable Koin.AndroidX.compose for time being Fixes crashes with Kotlin 1.5.0. See: https://github.com/InsertKoinIO/koin/issues/1076 — committed to luk1337/anitrend-v2 by luk1337 3 years ago
- Update Koin to 2.2.3 and disable Koin.AndroidX.compose for time being (#73) Fixes crashes with Kotlin 1.5.0. See: https://github.com/InsertKoinIO/koin/issues/1076 — committed to AniTrend/anitrend-v2 by luk1337 3 years ago
- OP-2311 - Upgrade patchfix version of KoIN to fix KotlinX Serialization dependency version issue Refer - github.com/InsertKoinIO/koin/issues/1076 — committed to endiosGmbH/Android-Config by soulskill 3 years ago
- OP-2311 - Upgrade patchfix version of KoIN to fix KotlinX Serialization dependency version issue Refer - github.com/InsertKoinIO/koin/issues/1076 — committed to endiosGmbH/Android-Config by soulskill 3 years ago
- Merge develop ➡️ master (#87) * Bump androidx.compose.* [1.0.0-beta03 -> 1.0.0-beta05] See: - androidx.compose.compiler:compiler [1.0.0-beta03 -> 1.0.0-beta05] https://developer.android.com... — committed to AniTrend/anitrend-v2 by wax911 3 years ago
As a temp workaround you should set your
KoinApplication.logger()toLevel.ERRORorLevel.NONE. Or just do not configure logger at all.I believe this is critical as more and more people will jump in
1.5.0kotlinDeployment 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.
For those facing with this problem, you can use dependencySubstitution in gradle (you can use any compatible version):
Is there supposed to be new versions of all modules?
io.insert-koin:koin-androidx-compose:3.0.2doesn’t seem to exist.I have the same issue, but without updating to Koltin 1.5.0, but with update
org.jetbrains.kotlinx:kotlinx-serialization-coreto 1.2.0koin = "3.0.1" kotlin = "1.4.32" kotlinxSerialization = "1.2.0"yes, migrate to maven central artifacts. This is the sure way 👍
Yep a 2.2.3 will appear soonly