Unity2018.4.7导出Xcode工程报错解决方案
1. unity导出xcode工程有两种模式,一种为模拟器运行的工程,一种为真机运行的工程,这里遇到的错误,都是导出模拟器运行工程时报的错误。
错误1:
unity UnityMetalSupport Duplicate interface definition for class ‘CAMetalLayer‘
解决方案:
//把报错的地方的代码替换为下方代码: @interface CAMetalLayer (category) @property (readwrite) BOOL framebufferOnly; @property (readwrite) CGSize drawableSize; @property BOOL presentsWithTransaction; @property (readwrite, retain) id<MTLDevice> device; @property (readwrite) MTLPixelFormat pixelFormat; @property (readonly) id<MTLTexture> texture; - (id<CAMetalDrawable>)newDrawable; - (id<CAMetalDrawable>)nextDrawable; @end
错误2:
Typedef redefinition with different types (‘void *‘ vs ‘struct __CVMetalTextureCach
解决方案:
解决方法很简单,在CVTextureCache.mm文件中,全局替换: 把 CVMetalTextureCacheRef 替换为 UCVMetalTextureCacheRef、 把 CVMetalTextureRef 替换为 UCVMetalTextureRef。
参考: