I have over 2 years of daily health data in the iPhone health app but when I "export health data" I obtain an empty (22 byte to be exact) export.zip file. How can I extract my data out of the phone? The app still has it and I can see the graphs, the individual data points etc. I have googled a bit and I see I am not the only one (see for example https://discussions.apple.com/thread/8244029), but I have found no solutions.
iPhone 6s+ with ios 11.4
EDIT 1 in response to request to show the exact steps:
Open the health app on the iphone
Go to the top level "health data" screen
Tap the red head in a circle in the top right corner
At the bottom of that screen, tap the red "Export Health Data"
At the dialogue box ("Are you sure you want to export your data? This may take a fem moments") say Export.
Wait for an annoyingly long time, of the order of 10 minutes, while it says "Exporting Health Data / Preparing..."
Export the data with any of the available methods. I have tried airdrop and emailing it to myself and in both cases I got an export.zip of 22 bytes.
More information than anyone asked for, which may or may not be relevant:
This phone replaces another one whose screen got cracked. I wanted to restart the new phone as a "new phone", instead of restoring from backup, but found that I would lose all my health data. So I very reluctantly did the backup but, while I was at it, I also attempted to export the health data to be able to access it from my own programs. On following all the steps above, at the penultimate step after waiting a long time the app would just crash and return me to the main iPhone home screen. That was extremely frustrating. I considered myself lucky that, on restoring the backup to the new phone, at least the health data was still available from within the app. On attempting to export it from the new phone I now don't get a crash, but I do get this empty 22 byte file, which isn't much of an advance.