thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/
Apache License 2.0
10.51k stars 2.49k forks source link

App crashed by typing address in the address field when composing a message #1251

Closed webratte closed 8 years ago

webratte commented 8 years ago

Expected behaviour

Should be possible typing addresses into the address field.

Actual behaviour

App crashed by typing address in the address field

Steps to reproduce

  1. Click the compose icon
  2. Try to type a address into the "To:" field

    Environment

K-9 Mail version: 5.108 (current alpha)

Android version: 5.0

Account type (IMAP, POP3, WebDAV/Exchange): IMAP

Valodim commented 8 years ago

does this happen for any address? After how many typed characters? What keyboard app do you use?

webratte commented 8 years ago

It happens by typing the second charter.

I use the standard Xperia Keyboard (https://play.google.com/store/apps/details?id=com.sonyericsson.textinput.uxp) on a Sony Xperia M4 Aqua.

Valodim commented 8 years ago

Ok, thanks. did you report the crash?

@cketti any stack trace for this?

webratte commented 8 years ago

What do you mean with "Report"? I'm just a User without developer skills.

BTW. By click on the reply Button to answere the Github mail, K9 chrashed also.

philipwhiuk commented 8 years ago

You should have got a dialog like this (but for K-9 obviously)

image

webratte commented 8 years ago

No, the K9 window disappear immediately after start typing the second character or press the reply button.

Philip notifications@github.com schrieb:

You should have got a dialog like this (but for K-9 obviously)

image


You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/k9mail/k-9/issues/1251#issuecomment-204951294

philipwhiuk commented 8 years ago

The activity window will disappear but you ought to get a follow-up dialogue telling you K-9 has crashed similar to above. If not the phone is doing something very odd and given we won't be able to get a stack trace as a result, there's not much we can do until someone else can reproduce it.

Given it seems to happen in other cases (like just clicking reply) I'd suggest re-installing the app (remember to export your settings).

philipwhiuk commented 8 years ago

See #1253 but @webratte talked about K-9 crashing just by clicking Reply.

webratte commented 8 years ago

I have just reinstalled the App. Now only the compose window is closing by typing the second character. The App stay open.

And no window for create/send a logfile.

cketti commented 8 years ago

Please follow these steps to record a debug log: https://github.com/k9mail/k-9/wiki/LoggingErrors

webratte commented 8 years ago

If I have a little bit more time I will check it out. Probably next Weekend.

ouafnico commented 8 years ago

Same problem on this version. It happens when creating a new mail. I can get over it clicking the 3 dots and chose "add from contacts".

webratte commented 8 years ago

I have just created a log (a few seconds after crash)

Is there a mail address where I can send this (particular makes anonymous) Log file? I don't know if there still sensible informations into the file. So I don't like to make it public.

If you check (and maybe clean it from sensible data), feel free to post it here.

philipwhiuk commented 8 years ago

You can email it me - philipATwhiuk.com - I'll look through it.

Unless you enabled sensitive logging there shouldn't be anything. But I'll clean anything up if there is :)

webratte commented 8 years ago

Done. I hope it helps. :-)

philipwhiuk commented 8 years ago

Stack trace :) Thanks to @webratte

java.lang.NullPointerException: Attempt to invoke virtual method 
    'android.content.Loader android.app.LoaderManager
    .restartLoader(int, android.os.Bundle, android.app.LoaderManager$LoaderCallbacks)' 
    on a null object reference
04-21 19:37:34.905 E/AndroidRuntime( 9726):
    at com.fsck.k9.view.RecipientSelectView.performFiltering(RecipientSelectView.java:253)
04-21 19:37:34.905 E/AndroidRuntime( 9726):
    at android.widget.MultiAutoCompleteTextView.performFiltering(MultiAutoCompleteTextView.java:101)
04-21 19:37:34.905 E/AndroidRuntime( 9726):
    at android.widget.AutoCompleteTextView.doAfterTextChanged(AutoCompleteTextView.java:783)
04-21 19:37:34.905 E/AndroidRuntime( 9726):
    at android.widget.AutoCompleteTextView$MyWatcher.afterTextChanged(AutoCompleteTextView.java:748)
04-21 19:37:34.905 E/AndroidRuntime( 9726):
    at android.widget.TextView.sendAfterTextChanged(TextView.java:7720)
....

So the loaderManager is obviously null, which means either:

1) onAttachedToWindow is never called 2) getContext() returns something that isn't an Activity. 3) activity.getLoaderManager() returns null

Per this http://stackoverflow.com/questions/3901590/get-activity-object-while-in-view-context/3901704#3901704 the second is quite likely.

We should probably switch to injecting the LoaderManager from the activity into the View rather than hoping we get the Activity back by calling getContext() when we get attached.