question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Koin MonoClock class not found with Kotlin 1.3.70

See original GitHub issue

Describe the bug An app with Koin 2.1.0 or 2.1.1 will crash at runtime with:

2020-03-03 11:48:45.259 18449-18449/com.example.base E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.base, PID: 18449
    java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/time/MonoClock;
        at org.koin.core.time.MeasureKt.measureDuration(Measure.kt:31)
        at org.koin.core.KoinApplication.modules(KoinApplication.kt:60)
        at com.example.base.App$startDependencyInjection$1.invoke(App.kt:23)
        at com.example.base.App$startDependencyInjection$1.invoke(App.kt:11)
        at org.koin.core.context.ContextFunctionsKt.startKoin(ContextFunctions.kt:39)
        at org.koin.core.context.ContextFunctionsKt.startKoin$default(ContextFunctions.kt:35)
        at com.example.base.App.startDependencyInjection(App.kt:20)
        at com.example.base.App.onCreate(App.kt:15)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6601)
        at android.app.ActivityThread.access$1300(ActivityThread.java:226)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1886)
    	at android.os.Handler.dispatchMessage(Ha

after upgrading to Kotlin 1.3.70.

To Reproduce Steps to reproduce the behavior:

  1. Create a simple Koin app with at least one module.
  2. Upgrade Kotlin to 1.3.70
  3. Run App.
  4. See error

Expected behavior Should not crash.

Koin project used and used version (please complete the following information): [e.g]: koin-core version 0.9.2

koin-android version 2.1.0 or 2.1.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:22
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
arnaudgiulianicommented, Mar 4, 2020

accepted PR.

Wait for 2.1.2 soon 👍

2reactions
nealsanchecommented, Mar 3, 2020

Compiling Koin using 1.3.70 reveals a good number of update suggestions:

w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/registry/InstanceRegistry.kt: (128, 52): Unchecked cast: Any? to S
w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/time/Measure.kt: (18, 20): 'typealias MonoClock = TimeSource.Monotonic' is deprecated. Use TimeSource.Monotonic instead.
w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/time/Measure.kt: (29, 2): 'UseExperimental' is deprecated. Please use OptIn instead.
w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/time/Measure.kt: (29, 2): This class can only be used with the compiler argument '-Xopt-in=kotlin.RequiresOptIn'
w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/time/Measure.kt: (31, 17): 'typealias MonoClock = TimeSource.Monotonic' is deprecated. Use TimeSource.Monotonic instead.
w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/time/Measure.kt: (37, 2): 'UseExperimental' is deprecated. Please use OptIn instead.
w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/time/Measure.kt: (37, 2): This class can only be used with the compiler argument '-Xopt-in=kotlin.RequiresOptIn'
w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/time/Measure.kt: (46, 2): 'UseExperimental' is deprecated. Please use OptIn instead.
w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/time/Measure.kt: (46, 2): This class can only be used with the compiler argument '-Xopt-in=kotlin.RequiresOptIn'
w: /Users/nealsanche/github/koin/koin-projects/koin-core/src/main/kotlin/org/koin/core/time/Measure.kt: (48, 17): 'typealias MonoClock = TimeSource.Monotonic' is deprecated. Use TimeSource.Monotonic instead.
Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin ...
I have recently updated the version of Kotlin to 1.3.70 in my Android project. Since then Koin (version: 2.1.0-beta-1 ) is giving me...
Read more >
Kotlin 1.3.70 Released - The JetBrains Blog
Today we're happy to present to you the latest version of Kotlin – 1.3.70. This incremental release doesn't provide any major new features....
Read more >
Kotlin releases
For 1.3.70, we had 2 bug fix releases – 1.3.71 and 1.3.72. ... The IDE support for the latest version of the language...
Read more >
Dependency Injection with Kotlin and Koin - Auth0
In this post, we'll look at a simple application taking advantage of Koin to inject dependencies into our custom classes. Prerequisites. To ...
Read more >
Kotlin Multiplatform Libraries
A modern I/O library for Android, Java, and Kotlin Multiplatform. ... Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found