I just did another hot code push of our app. It worked on Android but not on iOS. The cordovaCompatibilityVersion values have not changed, I confirmed that first thing, but of course Android wouldn’t have worked if the compatversion had changed.
Anyone have any idea why it would work on Android and not on iOS?
Ha! I’ve made this discovery: adding a couple of seemingly innocent png files to my /public/images directory has caused HCP to stop working on iOS. In the log of my iPhone (viewing it using xCode to open a console) that failed to get HCP after the latest update, I got this:
Download failure: Could not link to cached asset: Error Domain=NSCocoaErrorDomain Code=516 ““circle_green.png” couldn’t be linked to “images” because an item with the same name already exists.” UserInfo={NSSourceFilePathErrorKey=/var/mobile/Containers/Data/Application/2DCB2EF6-0F63-4394-944E-6827262A0849/Library/NoCloud/meteor/PartialDownload/app/images/circle_green.png, NSUserStringVariant=(
Link
), NSDestinationFilePath=/var/mobile/Containers/Data/Application/2DCB2EF6-0F63-4394-944E-6827262A0849/Library/NoCloud/meteor/Downloading/app/images/circle_green.png, NSFilePath=/var/mobile/Containers/Data/Application/2DCB2EF6-0F63-4394-944E-6827262A0849/Library/NoCloud/meteor/PartialDownload/app/images/circle_green.png, NSUnderlyingError=0x1c02445f0 {Error Domain=NSPOSIXErrorDomain Code=17 “File exists”}}
All I did to get HCP to work again for this version of code was to remove circle_green.png from my project and redeploy my app to Galaxy. Voila! HCP works again! Of course, this means my app isn’t displaying the now-missing png, but it solved HCP failure. And this png thing also doesn’t impact Android HCP, only iOS. I’m not sure what’s going on here, but this is the second problem I’ve encountered related to iOS and this error message. See also https://stackoverflow.com/questions/51573513/meteor-cordova-ios-file-already-exists-error-message-doesnt-make-sense for another problem caused by this same error message.
HCP on iOS is quite broken at the moment. Sometimes it works, but most of the time the connection between the app and the server gets lost and the app breaks. It even shows other weird effects, like missing images and fonts. This seems to be (another?) problem with the connection to the local server on the device.
I don’t know about the connection breaking, that hasn’t been a problem I’ve seen. But there’s definitely a thing going on with the above error message and meteor cordova on iOS. I hope someone from Meteor is seeing this. I’ve opened a bug: https://github.com/meteor/meteor/issues/10181
No news. As mentioned here (lots more detail): https://github.com/meteor/meteor/issues/10181,
The manifest contains two lines for each asset, which the code misinterprets because the code isn’t expecting that.