openfoodfacts / openfoodfacts-androidapp

(Legacy) Native version of Open Food Facts on Android - Coders & Decoders welcome 🤳🥫
https://android.openfoodfacts.org
Apache License 2.0
772 stars 446 forks source link

The app crashes at startup (develop) #4055

Closed sentry-io[bot] closed 3 years ago

sentry-io[bot] commented 3 years ago

Sentry Issue: OPENFOODFACTS-ANDROID-3K3

UninitializedPropertyAccessException: lateinit property sharedPreferences has not been initialized
    at openfoodfacts.github.scrachx.openfood.features.changelog.ChangelogDialog.getSharedPreferences(ChangelogDialog.kt:56)
    at openfoodfacts.github.scrachx.openfood.features.changelog.ChangelogDialog.getSavedVersionCode(ChangelogDialog.kt:171)
    at openfoodfacts.github.scrachx.openfood.features.changelog.ChangelogDialog.presentAutomatically(ChangelogDialog.kt:91)
    at openfoodfacts.github.scrachx.openfood.features.MainActivity.onCreate(MainActivity.kt:457)
    at android.app.Activity.performCreate(Activity.java:7327)
...
(14 additional frame(s) were not displayed)

RuntimeException: Unable to start activity ComponentInfo{org.openfoodfacts.scanner/openfoodfacts.github.scrachx.openfood.features.MainActivity}: kotlin.UninitializedPropertyAccessException: lateinit property sharedPreferences has not been initialized
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3114)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3257)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
...
(7 additional frame(s) were not displayed)
teolemon commented 3 years ago

The app crashes at startup (develop). It seems related to an import from preferences ?

teolemon commented 3 years ago

This seems related to that commit, possibly:https://github.com/openfoodfacts/openfoodfacts-androidapp/commit/6219c20ba69da26def2803dcc1167a7d835dc1ea

sentry-io[bot] commented 3 years ago

Sentry issue: OPENFOODFACTS-ANDROID-3JN

VaiTon commented 3 years ago

Should be fixed by 7f637bc3bb83116eb620d5d781f15c0ca88413b3