Xcode15报错处理

macOS Sonama 14.0
Xcode 15.0.1


Operation not permitted
https://blog.csdn.net/WangJiankun_ls/article/details/103110241

随之 Mac OS 的不断升级,使用某些程序时会遇到 Operation not permitted 相关的问题,形式多种多样。
解决方案如下:

1. 左上角点击选择‘System Preferences’

2. 选择 “Security & Privacy”

3. 选择 “Privacy”-->“Full Disk Access”

4. 点击左下角按钮获得管理员操作权限

5. 把出问题的应用程序加到 “Full Disk Access” 列表中


image.png

Error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead
https://github.com/CocoaPods/CocoaPods/issues/12065

image.png

post_install do |installer|
  # fix xcode 15 DT_TOOLCHAIN_DIR - remove after fix oficially - https://github.com/CocoaPods/CocoaPods/issues/12065
    system('sh fix-build-for-xcode15.sh')
    installer.aggregate_targets.each do |target|
        target.xcconfigs.each do |variant, xcconfig|
        xcconfig_path = target.client_root + target.xcconfig_relative_path(variant)
        IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
        end
    end
    
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference
            xcconfig_path = config.base_configuration_reference.real_path
            IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
        end
        # M1芯片的Mac可编译
        config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        config.build_settings['LD_NO_PIE'] = 'NO'
        config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
      end
    end
end

The FIRFirestoreSettings has an error after updating to XCode release version 15.0 on this line: // Public constant ABSL_CONST_INIT extern "C" const int64_t kFIRFirestoreCacheSizeUnlimited = Settings::CacheSizeUnlimited; Error: An attribute list cannot appear here
https://github.com/firebase/firebase-ios-sdk/issues/11840

Podfile文件里增加如下配置,目的是把FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings.mm文件里的
ABSL_CONST_INIT extern "C" const int64_t kFIRFirestoreCacheSizeUnlimited = Settings::CacheSizeUnlimited;去掉ABSL_CONST_INIT

post_install do |installer|
     system('sh fix-build-for-xcode15.sh')
 end

fix-build-for-xcode15.sh文件内容

echo "Fixing build for Xcode 15"
sed -i '' 's/ABSL_CONST_INIT extern "C" const int64_t kFIRFirestoreCacheSizeUnlimited =/extern "C" const int64_t kFIRFirestoreCacheSizeUnlimited =/g' Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings.mm

File not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a
解决方案:
参考:https://stackoverflow.com/questions/75574268/missing-file-libarclite-iphoneos-a-xcode-14-3

# 进入Xcode提示的位置
cd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/
# 创建文件夹
sudo mkdir arc
# 进入文件夹
cd  arc
# 下载缺少的文件
sudo git clone https://github.com/kamyarelyasi/Libarclite-Files.git .
# 授权
sudo chmod +x *
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容