SimpMusic has crashed on Windows
Duplicate Check
- [x] I confirm I searched for existing reports and found no duplicates.
Describe the Bug
java.io.IOException: Unable to rename C:\Users\somch.simpmusic\settings.preferences_pb.tmp to C:\Users\somch.simpmusic\settings.preferences_pb. This likely means that there are multiple instances of DataStore for this file. Ensure that you are only creating a single instance of datastore for this file. at androidx.datastore.a.q.a(FileStorage.kt) at androidx.datastore.a.k.a(DataStoreImpl.kt) at androidx.datastore.a.k$r.invokeSuspend(DataStoreImpl.kt) at androidx.datastore.a.k$r.invoke(DataStoreImpl.kt) at androidx.datastore.a.D.a(SingleProcessCoordinator.kt) at androidx.datastore.a.k.a(DataStoreImpl.kt) at androidx.datastore.a.k$g.invokeSuspend(DataStoreImpl.kt) at androidx.datastore.a.k$g.invoke(DataStoreImpl.kt) at kotlinx.coroutines.b.b.a(Undispatched.kt) at kotlinx.coroutines.b.b.a(Undispatched.kt) at kotlinx.coroutines.h.a(Builders.common.kt) at kotlinx.coroutines.g.a(Unknown Source) at androidx.datastore.a.k.a(DataStoreImpl.kt) at androidx.datastore.a.k.a(DataStoreImpl.kt) at androidx.datastore.a.k$t.invokeSuspend(DataStoreImpl.kt) at androidx.datastore.a.k$t.invoke(DataStoreImpl.kt) at androidx.datastore.a.C$a.invokeSuspend(SimpleActor.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt) at kotlinx.coroutines.U.run(DispatchedTask.kt) at kotlinx.coroutines.internal.q$a.run(LimitedDispatcher.kt) at kotlinx.coroutines.c.i.run(Tasks.kt) at kotlinx.coroutines.c.a.a(CoroutineScheduler.kt) at kotlinx.coroutines.c.a$c.run(CoroutineScheduler.kt) Suppressed: kotlinx.coroutines.internal.i: [aL{Cancelling}@7e40f665, java.util.concurrent.Executors$AutoShutdownDelegatedExecutorService@32e9659a]
Steps to Reproduce
Expected Behavior
\
App Version
1.2.1
Android Version
Device Model
Custom ROM
- [ ] I am using a custom ROM
Custom ROM Name (if applicable)
No response
Screenshots (optional)
Log / Error Details
No response
I am experiencing this exact same issue on my Windows machine as well. It looks like a classic Windows file-locking collision where DataStore is trying to rename the .tmp file while another instance still has it open.
Here is my stack trace for reference:
Plaintext java.io.IOException: Unable to rename C:\Users\zaibi.simpmusic\settings.preferences_pb.tmp to C:\Users\zaibi.simpmusic\settings.preferences_pb. This likely means that there are multiple instances of DataStore for this file. Ensure that you are only creating a single instance of datastore for this file. at androidx.datastore.a.q.a(FileStorage.kt) at androidx.datastore.a.k.a(DataStoreImpl.kt) at androidx.datastore.a.k$r.invokeSuspend(DataStoreImpl.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@394ae4fa, Dispatchers.Main.immediate] As the error suggests, ensuring PreferenceDataStoreFactory.create() is implemented as a strict Singleton (via an object or DI) should resolve this locking collision on Windows.
Fixed by 0f878947 (desktop: single-instance check before startKoin to avoid the DataStore multiple-instances crash). Closing as completed — reopen if it persists.