流星科尔多瓦iOS日志说PNG文件不存在时已经存在

时间:2018-07-28 17:06:30

标签: ios xcode cordova meteor

我正在运行meteor run ios-device ...,并正在查看Xcode中的日志。我在本地主机上使用热代码推送进行CSS更改,这些更改立即显示在iOS Simulator设备中。我将user_white.png添加到images文件夹,并在css中将url(...)指向它。我收到了我不理解的错误,因为user_white.png不“已经存在”。即使我停止在Xcode中启动模拟器,该错误仍然存​​在。知道这个错误是什么意思吗?

2018-07-28 12:48:51.511632-0400 Vium[41847:2439935] Download failure:   
Could not link to cached asset: Error Domain=NSCocoaErrorDomain Code=516 
"“user_white.png” couldn’t be linked to “images” because an item
with the same name already exists."
...
NSFilePath=/Users/opx/Library/Developer/CoreSimulator/Devices/6E759135-D5E3- 
4AC0-AF35-92FCC473A61D/data/Containers/Data/Application/D92D9589-4D22-4006- 
8A08-0AC35932E769/Library/NoCloud/meteor/PartialDownload/app/images/user_white.png,
NSUnderlyingError=0x60000024b520 {Error Domain=NSPO
2018-07-28 12:48:51.516594-0400 Vium[41847:2438252] ERROR: 
{"line":36,"column":30,
"sourceURL":"http://localhost:12072/plugins/cordova-plugin-meteor-webapp/www/webapp_local_server.js"}

2 个答案:

答案 0 :(得分:0)

更新: 这是Meteor中的错误-有关详细信息,请参见https://github.com/meteor/meteor/issues/10181,尤其是https://github.com/meteor/cordova-plugin-meteor-webapp/issues/56。此问题导致iOS Meteor Cordova热代码推送失败。在导致HCP失败的情况下,下面的答案是不够的,但是在Xcode调试中也会出现问题,该问题通过 通过停止/启动来解决,如下所述。

根据记录,此问题的答案是错误消息听起来很令人误解,user_white.png尚不存在对用户有意义的方式。解决方案非常简单:停止Xcode / iOS Simulator,停止在localhost上运行的Meteor服务器,然后重新运行meteor run ios-device ...

服务器端的重新构建以及Xcode中设备客户端的后续重新构建使问题消失了。热代码推送和Xcode设备模拟器的组合显然不能以报告您真正需要知道的方式来处理新的css引用图像,即:停止一切并重建应用程序!

答案 1 :(得分:0)

这是实际的答案:已将修复程序合并到cordova-plugin-meteor-webapp插件的流星代码中,因此从该插件的1.7.0版本开始,此问题已解决。有关详细信息,请参见我先前的“答案”中的链接,以及https://github.com/meteor/meteor/issues/10277的详细信息,但这已在流星中修复。