I verified that the problem is in the data of an activity and fixed it for myself. I knew that my problem started a couple of weeks ago, therefore I decided to export all the activities for the last couple of weeks, delete the activities and then import them back.
After logging in to connect.garmin.com on my laptop I exported the recent activities one by one, then I deleted them from connect.garmin.com. After I deleted those recent activities my stats page on my android phone started to work again. I then imported the same activities one by one and stats page continued to work. It looks like there was a corrupt data in one of the activities and exporting and importing it back fixed the problem. I imported all the activities back, therefore I did not lose any data.
One important point I should mention is how you should export your data. I first exported one treadmill activity using gpx format and imported it back for testing. After my treadmill runs I always use calibrate and save option on the watch because the distance displayed on the watch and the distance on the treadmill do not match. For this activity the distance on the watch was 5.60km but when I saved it I had corrected it to 5.00km. In my garmin account it was showing as 5.00km but after exporting and importing in gpx format it displayed 5.60km, which means that it lost the calibration information.
I did not check if I lost any other data or not, instead I tried the Export Original option. In this option the the export file is in *.zip format and inside that file there is a *.fit file. You have to extract and save the *.fit file first so that you can import it back. With this method the calibration information was preserved and the imported activity displayed 5.00km. The only two information I realized missing with this format so far are the name of the activity and the gear used. If you rename the activities, they switch back to their original names after importing the fit file, and the gear (Shoe in my case) switches back to original as well. I had shoe X set as default for running but I was using shoe Y for treadmill, therefore after the run I had edited the gear section and removed shoe X and added Shoe Y. After exporting and importing the fit file back, shoe X was selected and I had to change it to shoe Y again.
In summary to fix your problem follow these steps;
- Export your files by using Export Original method
- Extract the .fit file from the .zip file
- Delete your activities from connect.garmin.com
- Import the .fit files back
- Correct the names of the activities and gear used if you had edited them originally
The only problem is that, if you do not know when your stats page stopped working, you should start from the last activity and go back repeating this method until you find the corrupt activity.