Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lateinit property filesDir has not been initialized #1833

Open
sheinin opened this issue Sep 13, 2024 · 1 comment
Open

lateinit property filesDir has not been initialized #1833

sheinin opened this issue Sep 13, 2024 · 1 comment

Comments

@sheinin
Copy link

sheinin commented Sep 13, 2024

How frequently does the bug occur?

Once

Description

A crash is being reported to PlayStore Console for the device "samsung r0s" after upgrading to Kotlin Realm 2.1.0

Stacktrace & log output

Exception java.lang.RuntimeException:
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:4164)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:4322)
  at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:103)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:139)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:96)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2685)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:230)
  at android.os.Looper.loop (Looper.java:319)
  at android.app.ActivityThread.main (ActivityThread.java:8919)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
Caused by kotlin.UninitializedPropertyAccessException: lateinit property filesDir has not been initialized
  at io.realm.kotlin.internal.RealmInitializer$Companion.getFilesDir (RealmInitializer.kt:34)
  at io.realm.kotlin.internal.platform.SystemUtilsAndroidKt.appFilesDirectory (SystemUtilsAndroid.kt:30)
  at io.realm.kotlin.RealmConfiguration$Builder.<init> (RealmConfiguration.kt:54)
  at io.realm.kotlin.RealmConfiguration$Companion.create (RealmConfiguration.kt:196)
  at com.nearmeentertainment.vegasnearme.MainActivity.onCreate (MainActivity.kt:238)
  at android.app.Activity.performCreate (Activity.java:8975)
  at android.app.Activity.performCreate (Activity.java:8944)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1456)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:4146)

Can you reproduce the bug?

No

Reproduction Steps

No response

Version

2.1.0

What Atlas App Services are you using?

Atlas Device Sync

Are you using encryption?

Yes

Platform OS and version(s)

Android 14 (SDK 34)

Build environment

Android Studio version: Koala Feature Drop | 2024.1.2
Android Build Tools version: 35
Gradle version: 8.0.2

Similar to the issue described here but Hilt is not used #1799

lateinit var realmLocal: Realm

// MainActivity:238
realmLocal = Realm.open(RealmConfiguration.create(schema = setOf(Items.Item::class)))
Copy link

sync-by-unito bot commented Sep 13, 2024

➤ PM Bot commented:

Jira ticket: RKOTLIN-1128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant