我的应用程序在模拟器和其他设备上运行良好。我有一部带有最新 iOS 更新的 iPhone 4,但该应用程序拒绝在我的设备上运行。
这似乎是围绕视网膜显示图像的问题。尝试在手机上运行时出现的错误是:
2012-01-11 09:27:47.404 rr_game1[1569:707] cocos2d: cocos2d v1.0.1
2012-01-11 09:27:47.413 rr_game1[1569:707] cocos2d: Using Director Type:CCDirectorDisplayLink
2012-01-11 09:27:47.845 rr_game1[1569:707] cocos2d: OS version: 5.0.1 (0x05000100)
2012-01-11 09:27:47.849 rr_game1[1569:707] cocos2d: GL_VENDOR: Imagination Technologies
2012-01-11 09:27:47.853 rr_game1[1569:707] cocos2d: GL_RENDERER: PowerVR SGX 535
2012-01-11 09:27:47.856 rr_game1[1569:707] cocos2d: GL_VERSION: OpenGL ES-CM 1.1 IMGSGX535-63.14.2
2012-01-11 09:27:47.861 rr_game1[1569:707] cocos2d: GL_MAX_TEXTURE_SIZE: 2048
2012-01-11 09:27:47.864 rr_game1[1569:707] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
2012-01-11 09:27:47.867 rr_game1[1569:707] cocos2d: GL_MAX_SAMPLES: 4
2012-01-11 09:27:47.871 rr_game1[1569:707] cocos2d: GL supports PVRTC: YES
2012-01-11 09:27:47.874 rr_game1[1569:707] cocos2d: GL supports BGRA8888 textures: YES
2012-01-11 09:27:47.877 rr_game1[1569:707] cocos2d: GL supports NPOT textures: YES
2012-01-11 09:27:47.880 rr_game1[1569:707] cocos2d: GL supports discard_framebuffer: YES
2012-01-11 09:27:47.883 rr_game1[1569:707] cocos2d: compiled with NPOT support: NO
2012-01-11 09:27:47.886 rr_game1[1569:707] cocos2d: compiled with VBO support in TextureAtlas : YES
2012-01-11 09:27:47.889 rr_game1[1569:707] cocos2d: compiled with Affine Matrix transformation in CCNode : YES
2012-01-11 09:27:47.892 rr_game1[1569:707] cocos2d: compiled with Profiling Support: NO
2012-01-11 09:27:48.012 rr_game1[1569:707] Game manager singleton, init
2012-01-11 09:27:48.031 rr_game1[1569:707] cocos2d: WARNING: Image (1024 x 4096) is bigger than the supported 2048 x 2048
2012-01-11 09:27:48.035 rr_game1[1569:707] cocos2d: Couldn't add image:grid.png in CCTextureCache
2012-01-11 09:27:48.047 rr_game1[1569:707] cocos2d: WARNING: Image (1024 x 4096) is bigger than the supported 2048 x 2048
2012-01-11 09:27:48.050 rr_game1[1569:707] cocos2d: Couldn't add image:bg-circuits.png in CCTextureCache
2012-01-11 09:27:48.054 rr_game1[1569:707] *** Assertion failure in -[CCParallaxNode addChild:z:parallaxRatio:positionOffset:], /Users/kevin/code/rr_game1/rr_game1/libs/cocos2d/CCParallaxNode.m:91
2012-01-11 09:27:48.058 rr_game1[1569:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Argument must be non-nil'
奇怪的是,它吐出的图像在应用程序中。
同样,该应用程序适用于其他设备和模拟器。这是加载图像的代码:
backgroundNode = [CCParallaxNode node];
[self addChild:_backgroundNode z:-1];
_backgroundGrid1 = [CCSprite spriteWithFile:@"grid.png"];
_backgroundCircuits1 = [CCSprite spriteWithFile:@"bg-circuits.png"];
_backgroundGrid1.anchorPoint = CGPointMake(0,0);
_backgroundCircuits1.anchorPoint = CGPointMake(0,0);
CGPoint gridSpeed = ccp(0.05, 0.05);
CGPoint circuitSpeed = ccp(0.1, 0.1);
[_backgroundNode addChild:_backgroundGrid1 z:1 parallaxRatio:gridSpeed positionOffset:ccp(0,-winSize.height)];
[_backgroundNode addChild:_backgroundCircuits1 z:0 parallaxRatio:circuitSpeed positionOffset:ccp(0,-winSize.height)];
我已经从手机中删除了该应用程序,运行“干净”,重新启动 Xcode,然后重新启动计算机。仍然没有运气。我也重新配置了我的手机。我还删除了资产并将其重新添加到项目中。