iTunes connect - You must upload a valid screenshot
Upload screenshots of 1242×2208 resolution (iPhone 6 Plus).
If your app is the same across device sizes and localizations, you can use the highest resolution screenshot for each device type; this set will scale appropriately for other device sizes when viewed on the App Store in each localization available in iTunes Connect. For example, if your app supports only the iPhone, you can provide 5.5-inch display screenshots and you do not need separate screenshots for the 4.7-inch, 4.0-inch and 3.5-inch displays.
See Screenshot Properties section here for details
I would like to add to the accepted answer because regurgitating the documentation does little to resolve actual problems.
After taking a screen shot of the app on my device for in app purchase review and it still didn't work, I did some investigating.
After you attempt to upload a screen shot and see the error to upload a valid size, you can open the browser inspector to see the error details. The image MUST be one of these dimensions: accepted resolutions found in console error
Something else I didn't realize is when taking screen shots with command-shift-4 on macbooks, when you hold it down for the drag you can see the actual dimensions of the screen shot you are taking, but for some reason it saves it as DOUBLE the size. I ended up taking a screen shot where the cross hairs of the screen shot say 320 x 480 resulting in a saved png of 640x960. It has to be one of the pre set sizes in order for image upload to accept it.
After banging my head on a wall for a couple hours I figured this out, so I hope this helps others .
screenshot of the in-app purchase as it appears on the device. This screenshot is used for Apple’s review only and is not displayed on the App Store.
Screenshots requirements are outlined below:
iOS requires at least 640 x 920 pixels. tvOS requires 1920 x1080 pixels. macOS requires 1280 x 800 pixels. After you upload an app review image, you can replace it, but you can’t remove it. You can’t update the screenshot while you in-app purchase is in review.