enviroCar / enviroCar-app

enviroCar Android Application
https://envirocar.org
GNU General Public License v3.0
88 stars 154 forks source link

CRASH - When we go to CarselectionFragment (Cars) the app crashes on loading data #740

Closed asaikarthikeya closed 2 years ago

asaikarthikeya commented 2 years ago

Steps to reproduce the bug :

Sign in to the enviroCar account -> Go to My cars section

The app crashes every time i try to go to " My Cars" section.

Tested on

  1. Samsung F62 APK 30
  2. ASUS Zenfone APK 29
  3. Emulator

I am able to reproduce on all the above devices. Screen recording after following the above steps.

https://user-images.githubusercontent.com/70392921/119265243-96736200-bc03-11eb-8092-6c62cb6dcaa7.mp4

asaikarthikeya commented 2 years ago

119146218-0c42c680-ba68-11eb-9bf8-4ce53058ce31

I think the carAttributesToString() method is producing the Null pointer exception which is present in the Car.Utils file. Due to this the car views are unable to get display and app crashes.

I have been trying to figure out the reason from the past 3-4 days. I referred all the related concepts and Stackoverflow questions but unable to conclude the right approach to solve this. @arvindnegi1 ,@bpross-52n please share your thoughts on this sir. Thank you.

asaikarthikeya commented 2 years ago

@SebaDro Please have a look at this issue sir. Thank you.

arvindnegi1 commented 2 years ago

@asaikarthikeya its seems like some invalid car type has been added in the server. Can you please check for that, because it crashes while specific user car is fetched so maybe it has previously allowed to add invalid car type. I tried to reproduce the issue but unable to. You can check for that using if(!(car.getConstructionYear()==null|| car.getConstructionYear().isEmpty()) ) similarly check for fuel type and engine displacement null before if this will work after this then surely some invalid car type in server for this user.

asaikarthikeya commented 2 years ago

This issue is present since the last 2 months. Not sure, But now the app works fine. Closing this issue as i am unable to reproduce it. Thank you @arvindnegi1 for sharing your thoughts on this.

D-Ajay-Kumar commented 2 years ago

I face the same issue. The way I produced this was by deleting the data of the app from my phone's settings and opening the cars screen. The data deletion must've wiped the locally stored cars data which the app now fails to fetch.

asaikarthikeya commented 2 years ago

Now, Again i am able to reproduce this issue. Nothing to do with the user being logged in.