Skip to content

Commit d6875f9

Browse files
committed
Disable FastServiceLoader of Kotlin Coroutines.
cf. Kotlin/kotlinx.coroutines#1231
1 parent 4167732 commit d6875f9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sample_app/src/main/java/com/linecorp/lich/sample/MyApplication.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ import android.os.StrictMode
2020

2121
class MyApplication : Application() {
2222

23+
init {
24+
// Disable FastServiceLoader.
25+
// To avoid StrictMode DiskReadViolation, we use the standard ServiceLoader to load
26+
// MainDispatcherFactory.
27+
// cf. https://github.com/Kotlin/kotlinx.coroutines/issues/1231
28+
System.setProperty("kotlinx.coroutines.fast.service.loader", "false")
29+
}
30+
2331
override fun onCreate() {
2432
super.onCreate()
2533

0 commit comments

Comments
 (0)