Failed to build module 'xxx'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5 effective-4.2 (swiftlang-1300.0.31.1 clang-1300.0.29.1)', while this compiler is 'Apple Swift version 5.5.2 effective-4.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)'). Please select a toolchain which matches the SDK.
在build setting中將BUILD_LIBRARY_FOR_DISTRIBUTION設(shè)置為Yes
-
Include of non-modular header inside framework module
該問題發(fā)生場景為:依賴第三方framework,且項(xiàng)目中只能看到framework,頭文件必須在Finder中才能看到。
解決:如果能看到頭文件,在build perhaps->Headers中將頭文件放到public中。如果看不到,需要在build setting->OTHER_SWIFT_FLAGS中添加-Xcc -Wno-error=non-modular-include-in-framework-module
3.SDK依賴第三方庫,在導(dǎo)入SDK后pod對應(yīng)庫后編譯出現(xiàn)Undefined symbols
解決:找到對應(yīng)三方庫的TARGETS -> Build Settings -> BUILD_LIBRARY_FOR_DISTRIBUTION 設(shè)置為YES
Sandbox: rsync.samba(13741) deny(1) file-write-create
TARGETS -> Build Settings -> ENABLE_USER_SCRIPT_SANDBOXING -> No
5.導(dǎo)入C或者OC的頭文件報(bào)錯
第一種,將header文件在Build Phases -> Headers中設(shè)置為Public,然后在xxx.h(如framework叫abc,會有一個abc.h)import。
可能會遇到的錯誤:
double-quoted include "xxx.h" in framework header, expected angle-bracketed instead
解決:將#import "xxx.h" 改為 #import <framework的名字/xxx.h> ,在c或oc文件中報(bào)這個錯誤也用相同方式解決(include)
第二種,modulemap
暫未遇到問題