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。

 

參考:

1.https://www.jianshu.com/p/e80980a02060 古道西風瘦啥

2.https://www.jianshu.com/p/058cb8bf0a63 古道西風瘦啥


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM