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.

K-9 fails to import settings and then crashes

See original GitHub issue

Checklist

  • I have used the search function to see if someone else has already submitted the same bug report.
  • I will describe the problem with as much detail as possible.

App version

5.914 (git 0e78b8aae6bda14aca094298813b50759b50e8cb)

Where did you get the app from?

Built from source

Android version

API level 29

Device model

Emulator

Steps to reproduce

Export settings and immediately re-import. You get a toast “import failed”. Clearing the app data and trying to import the settings file also fails.

There is nothing particularly interesting about the settings, it’s a standard IMAP/SMTP setup. The emulator is a bit slow due to RAM constraints so I’m wondering if there is a race when writing the newly created accounts to storage.

Expected behavior

K-9 should import the settings

Actual behavior

K-9 fails to import the settings with an error message. If you keep trying to import, K-9 completely crashes.

Logs

logcat says

2022-04-04 16:32:55.897 7076-7076/com.fsck.k9.debug E/SettingsImportViewModel$startImportSettings: Error importing settings
    com.fsck.k9.preferences.SettingsImportExportException: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter account
        at com.fsck.k9.preferences.SettingsImporter.importSettings(SettingsImporter.java:298)
        at com.fsck.k9.ui.settings.import.SettingsImportViewModel.importSettings(SettingsImportViewModel.kt:363)
        at com.fsck.k9.ui.settings.import.SettingsImportViewModel.access$importSettings(SettingsImportViewModel.kt:28)
        at com.fsck.k9.ui.settings.import.SettingsImportViewModel$startImportSettings$1$1$1.invokeSuspend(SettingsImportViewModel.kt:282)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
     Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter account
        at com.fsck.k9.mailstore.SpecialLocalFoldersCreator.createSpecialLocalFolders(Unknown Source:2)
        at com.fsck.k9.preferences.SettingsImporter.importSettings(SettingsImporter.java:287)
        at com.fsck.k9.ui.settings.import.SettingsImportViewModel.importSettings(SettingsImportViewModel.kt:363) 
        at com.fsck.k9.ui.settings.import.SettingsImportViewModel.access$importSettings(SettingsImportViewModel.kt:28) 
        at com.fsck.k9.ui.settings.import.SettingsImportViewModel$startImportSettings$1$1$1.invokeSuspend(SettingsImportViewModel.kt:282) 
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39) 
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
artbristolcommented, Apr 4, 2022

Yes, importing works OK after that PR, thanks

0reactions
cketticommented, Apr 4, 2022

PR #6001 fixes this for me. Can you please check if it also works for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import settings crashes on older phones · Issue #2935
K9 crashes when you hit the home button. Steps to reproduce. Open K9 on older phone (tested on API 15); Click 'Import Settings...
Read more >
5.8 update installation crashes - Support
Hi, I tried to update my K-9 mail client (5.6) which I use for a looking time ... then select Settings Import &...
Read more >
unable to import settings.k9s on galaxy nexus
K-9 mail 4.005 is unable to import the settings.k9s, which I exported ... File Manager and restore the settings, Then just uninstall OI...
Read more >
What should I do when I receive an export error or crash?
If your project will not export, go through this checklist of possible solutions. Please check and try your export after each procedure.
Read more >
swift - iOS app with framework crashed on device, dyld
I was importing one of my own frameworks, which previously worked, but started issuing the "dyld: Library not loaded" error. To be clear,...
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