-
Notifications
You must be signed in to change notification settings - Fork 383
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
Sample app crashes when Contact List Example clicked on Xperia X Performance #7
Comments
The earliest error occurs at Line 45 in ContactListActivity.java.
Code:
|
I didn't specify an onError handler, and I think that's why the exception occurred. |
The problem still persists with the same error log. What is RXPermissions? I have never seen it before and I don't know what it does. |
RxPermissions is a RxJava library for Android M runtime permissions. Here it is used to get read contacts permission. So I looked at the logs you put, and the error is apparently caused by the fact that the contact list is null, but it seems weird. It's difficult to debug without your phone haha. Test this apk and tell me if you see a toast message : |
Sorry, there is no toast message before the app crashes. This is really weird, why would the app crash after requesting permissions? Only after permissions are granted does the app fail. If permissions are not granted, the app fails only after the "Enter a name" box loses focus. If permissions are granted, clicking on Don't worry about it too much. Please only make it an issue if someelse reports this behavior too! Thanks for trying to debug this issue. |
Yes it's weird, maybe it is because of RxPermissions library. I will try to use the "normal way" of asking permission to see if it works better. You don't have any issues on other apps with your Xperia ? |
Not so far. My old development device bootlooped and this new phone isn't even a week old. All my apps are working correctly so far. I am not sure that requesting permissions than normally would solve the thought of it because the permission request dialogue appears correctly. Low priority issue until someone can confirm it's not specific to me. Very weird! |
Ok we'll see if anyone else will have the same issue. |
I have the same issue and I'm on an Xperia Z3, same permissions issue thought to be the problem. I have found its
and the line;
Then
both mFilterableListBackgroundColor, mFilterableListTextColor are null values, not sure if that's the issue |
Ok so maybe the problem has to do with RxPermissions. I will make a sample app without this library and post the apk on this conversation. We'll see if it is better |
I've traced it back to the FilterableAdapter constructor and the following code
its iterates through many of my 300+ contacts then crashes, I have a feeling its too time consuming for the amount of contacts, out of my league here lol |
Yeah ok thanks, maybe this is the sorting which is the responsible, and not RxPermissions haha. I don't know why I put the This evening I will post an apk with the changes, hoping it will resolve the issue. |
Not a problem ;) Edit:
|
Good to see that I'm not crazy :D |
You're not crazy haha. |
The app wouldn't install on my phone for some reason, did you just change the sorting code? |
Yeah I think it's because I built the apk on a different computer, so the signed key of the apk is different. Please just uninstall the app from your phone, then install the apk I posted. |
I did uninstall the original but it still failed |
Well that's weird. And you can install previous apks without failing ? This is just the last apk that fails ? Because yes I just changed the sorting code |
I only ever built the app in android studio to my phone, never previously used the apk's |
Yes but now I make my changes on a different branch before merge it to the master. And I suppose that you forked or cloned the master branch, so the changes are not effective. Did you try to install directly the last apk I posted on this conversation ? |
I haven't forked it, I will look for your changes and test that in a few moments, Yeah I tried your apk for the first time from this conversation. |
Ok I have 365 contacts in the list, when it gets to your sorting its crashing because its finding nulls in o1.getLabel(), o2.getLabel()
So I ran the following code to eliminate the nulls just before the compare
and it works as fully expected, turns out, when I go into my contact list on the phone, at the very bottom of the list there are several entries flagged as "unknown" which I cant delete for some reason but seems to be added by outlook app. Might be good to filter these out of the list anyway for others who have rogue apps messing with their contact lists lol |
Ah great, that's why the app crashes, good job. I didn't know that's it possible to have a contact without a name ! I made the changes you suggest, and test it and it seems to work. If you could test this apk. If it works we will be able to close this issue, finally ! |
its crashing with your loop, presumably missing one via index changes
but works with this one
I saw the nulls are random in the list and in groups at places, so whether your loop is skipping over one somewhere when the indexes of them change when the first is removed I'm not sure. |
Unfortunately, the last apk still crashes with the same error. I am not that familiar with RxJava so I'm sorry for not being able to do much 🤷♂️ |
@searchy2 check your phones contact list to see if there are entries at the end of the list listed as "unknown", this is the reason for the error on mine |
When you click on an unknown I find it to have my email from outlook in there, strange issue, and doesn't delete... |
My unknown contacts have nothing in them. No emails, no nothing! I am able to delete them however so there's that. Let me delete all my known contacts and then load up Material Chips to see if it fixes the crashing. |
I just tried deleting the unknowns and then using Material Chips. Still crashes :( Guess the unknowns are not the issue here. |
Ok sorry for the delay. Yeah you're right @DreamCatcha, an iterator must be used when removing item from a list while iterating over it. My loop wasn't correct. I made the changes. Hope this one will work, here the apk |
No more crashes :D Great work @pchmn and @DreamCatcha @DreamCatcha if you can confirm that there are no crashes with Unknown contacts, this issue can finally be closed 😆 |
Yep that works fine now, thanks mate |
Nice! Great library with great support; so happy to see this problem fixed! |
How to reproduce on Xperia X Performance:
Could React Java be causing a problem here? I am testing on a Sony Xperia X Performance with Android Nougat. The library seems to work fine in the emulators. What could the problem be on my Android device?
The text was updated successfully, but these errors were encountered: