我的iOS7项目使用SpriteKit
和多个SKTextureAtlas
。我可以使用xCode5.1.1
构建并运行它而没有任何问题。
尝试使用xCode Command Line Tools
的构建服务器运行.ipa构建,在尝试加载第一个纹理图集时,它会在启动时崩溃:
Last Exception Backtrace:
0 CoreFoundation 0x18de52f50 __exceptionPreprocess + 132
1 libobjc.A.dylib 0x19a35c1fc objc_exception_throw + 60
2 CoreFoundation 0x18de52e90 +[NSException raise:format:] + 128
3 SpriteKit 0x190cdc4f8 -[SKTextureAtlas loadTextures] + 2708
4 SpriteKit 0x190cdd440 +[SKTextureAtlas atlasNamed:] + 208
.
.
目录myTextures.atlas
包含在.app
内容以及实际的.png
文件中。
编辑:
似乎Command Line Tools
忽略Enable Texture Atlas Generation
构建设置。
我可以通过以下方式解决这个问题:
将构建设置Enable Texture Atlas Generation
设置为否
将以下内容添加为Build Phrase shell脚本:
cd "$CONFIGURATION_BUILD_DIR"/*.app
/Applications/Xcode.app/Contents/Developer/usr/bin/TextureAtlas myAtlas.atlas
我认为这是一个Apple bug并提交了它,但更好的解决方案受到高度赞赏!