1。xcode每次调试运行的时候都要编译一遍所有的class文件
解决方案:把项目文件拖拽到另外一个路径再重新编译!(clean all targets我试了n遍,没用)~
2。cocos2d 2。0
Failed to load shader
2012-01-23 05:01:40.018 FrozenFish0.1[4744:10a03] cocos2d: cocos2d v2.0.0-alpha
2012-01-23 05:01:40.019 FrozenFish0.1[4744:10a03] cocos2d: Using Director Type:CCDirectorDisplayLink
2012-01-23 05:01:40.040 FrozenFish0.1[4744:10a03] cocos2d: OS version: 5.0 (0x05000000)
2012-01-23 05:01:40.041 FrozenFish0.1[4744:10a03] cocos2d: GL_VENDOR: Apple Computer, Inc.
2012-01-23 05:01:40.043 FrozenFish0.1[4744:10a03] cocos2d: GL_RENDERER: Apple Software Renderer
2012-01-23 05:01:40.044 FrozenFish0.1[4744:10a03] cocos2d: GL_VERSION: OpenGL ES 2.0 APPLE
2012-01-23 05:01:40.046 FrozenFish0.1[4744:10a03] cocos2d: GL_MAX_TEXTURE_SIZE: 4096
2012-01-23 05:01:40.048 FrozenFish0.1[4744:10a03] cocos2d: GL_MAX_SAMPLES: 4
2012-01-23 05:01:40.049 FrozenFish0.1[4744:10a03] cocos2d: GL supports PVRTC: YES
2012-01-23 05:01:40.050 FrozenFish0.1[4744:10a03] cocos2d: GL supports BGRA8888 textures: YES
2012-01-23 05:01:40.051 FrozenFish0.1[4744:10a03] cocos2d: GL supports NPOT textures: YES
2012-01-23 05:01:40.052 FrozenFish0.1[4744:10a03] cocos2d: GL supports discard_framebuffer: YES
2012-01-23 05:01:40.052 FrozenFish0.1[4744:10a03] cocos2d: compiled with VBO support in TextureAtlas : YES
2012-01-23 05:01:40.055 FrozenFish0.1[4744:10a03] cocos2d: compiled with Profiling Support: NO
2012-01-23 05:01:40.071 FrozenFish0.1[4744:10a03]
Failed to load shader
2012-01-23 05:01:40.072 FrozenFish0.1[4744:10a03] Failed to compile vertex shader
2012-01-23 05:01:40.073 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:40.074 FrozenFish0.1[4744:10a03] Failed to compile fragment shader
2012-01-23 05:01:40.076 FrozenFish0.1[4744:10a03] cocos2d: GLProgram: error linking program: 1
2012-01-23 05:01:40.077 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:40.078 FrozenFish0.1[4744:10a03] Failed to compile vertex shader
2012-01-23 05:01:40.079 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:40.080 FrozenFish0.1[4744:10a03] Failed to compile fragment shader
2012-01-23 05:01:40.080 FrozenFish0.1[4744:10a03] cocos2d: GLProgram: error linking program: 1
2012-01-23 05:01:40.081 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:40.082 FrozenFish0.1[4744:10a03] Failed to compile vertex shader
2012-01-23 05:01:40.083 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:40.084 FrozenFish0.1[4744:10a03] Failed to compile fragment shader
2012-01-23 05:01:40.084 FrozenFish0.1[4744:10a03] cocos2d: GLProgram: error linking program: 1
2012-01-23 05:01:40.085 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:40.087 FrozenFish0.1[4744:10a03] Failed to compile vertex shader
2012-01-23 05:01:40.088 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:40.089 FrozenFish0.1[4744:10a03] Failed to compile fragment shader
2012-01-23 05:01:40.089 FrozenFish0.1[4744:10a03] cocos2d: GLProgram: error linking program: 1
2012-01-23 05:01:40.091 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:40.093 FrozenFish0.1[4744:10a03] Failed to compile vertex shader
2012-01-23 05:01:40.094 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:40.094 FrozenFish0.1[4744:10a03] Failed to compile fragment shader
2012-01-23 05:01:40.095 FrozenFish0.1[4744:10a03] cocos2d: GLProgram: error linking program: 1
OpenGL error 0x0501 in -[CCShaderCache loadDefaultShaders] 160
OpenGL error 0x0501 in -[CCDirector setOpenGLView:] 297
2012-01-23 05:01:40.096 FrozenFish0.1[4744:10a03] Retina Display Not supported
2012-01-23 05:01:40.100 FrozenFish0.1[4744:10a03] cocos2d: surface size: 480x320
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
2012-01-23 05:01:41.247 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:41.248 FrozenFish0.1[4744:10a03] Failed to compile vertex shader
2012-01-23 05:01:41.249 FrozenFish0.1[4744:10a03] Failed to load shader
2012-01-23 05:01:41.249 FrozenFish0.1[4744:10a03] Failed to compile fragment shader
2012-01-23 05:01:41.250 FrozenFish0.1[4744:10a03] cocos2d: GLProgram: error linking program: 1
OpenGL error 0x0501 in -[MaskedSprite initWithFile:] 43
OpenGL error 0x0501 in -[MaskedSprite initWithFile:] 49
2012-01-23 05:01:41.251 FrozenFish0.1[4744:10a03] cocos2d: Frame interval: 1
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 380
解决方案参见一篇帖子:
cocos2d 2.0 beta + ARC = problems loading the shaders? (they're included I know)
解决方案如下:
Make sure that the shaders are included in the project:
Xcode -> Project -> Build Phases -> Copy Bundle Resources
解决了几个bug(XCode每次都编译所有文件,cocos2d2.0 shader load error)