building for iOS Simulator, but linking in object file built for iOS
今天升級了XCode12香缺,發(fā)現(xiàn)模擬器編譯報(bào)錯(cuò):
image.png
是linker鏈接器報(bào)了錯(cuò):
building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64
原來xcode12模擬器已經(jīng)用arm架構(gòu)來編譯項(xiàng)目了幢炸,而link鏈接的還是x86架構(gòu)
臨時(shí)解決方法:
Target——Build Settings最下面有個(gè)VALID_ARCHS,這個(gè)VALID_ARCHS在xcode12中已經(jīng)淘汰了敦姻,但有些cocoapod集成進(jìn)來的三方庫還是有這個(gè)key,比如這個(gè)極光認(rèn)證:
image.png
在項(xiàng)目Target——Build Settings里找到它
image.png
加一個(gè)x86_64
image.png
PS:直接把VALID_ARCHS的value刪了也能編譯成功歧杏,但是我這邊運(yùn)行會(huì)報(bào)沒有權(quán)限訪問項(xiàng)目.app文件的錯(cuò)
在VALID_ARCHS中加入了x86_64之后我這里就可以正常運(yùn)行了