Ionic 离子电容器:尝试在Apple M1上运行iOS live reload时出错

o2gm4chl  于 2023-05-15  发布在  Ionic
关注(0)|答案(1)|浏览(126)

我在Apple M1计算机上使用以下命令运行带有live reload的Ionic React应用时遇到问题:
ionic capacitor run ios -l --external
它会导致一堆(7-10)与target 'CapacitorCordova' from project 'Pods'相关的构建错误。
以下是其中一个示例(它们都非常相似):
CompileC /Users/${myUserName}/${myAppName}/ios/DerivedData/3D9B99DC-5F3F-4063-A938-63CABEB81D07/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/CapacitorCordova.build/Objects-normal/x86_64/CDVInvokedUrlCommand.o /Users/${myUserName}/${myAppName}/node_modules/@capacitor/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'CapacitorCordova' from project 'Pods')
有趣的是,我在构建应用程序并在Xcode的模拟器中运行它时没有遇到任何麻烦。这将是很好的有它活重新加载,因为我做的变化虽然。
我试过了

  • 使用默认Ruby安装Cocoapods
  • 用Homebrew安装最新版本的Ruby,然后用最新的Ruby安装CocoApods
  • 用自制软件安装cocoapods
  • 卸载所有东西(cocoapods,homebrew等),然后在运行Rosetta的终端中重新安装
  • 清理Xcode构建并删除DerivedData文件夹的内容
  • ios/App目录下解集成Pod并重新安装Pod
  • 使用Rosetta运行Xcode
  • 在Xcode的Build Settings中将Build Active Architecture Only设置为yes
  • arm64添加到构建设置中的排除体系结构列表中
    Xcode版本:14.0.1
    MacOS:Monterey,版本12.6
    离子版本:6
62o28rlo

62o28rlo1#

我在2014年的MacBook Pro上也遇到了同样的问题。如果有人解决了这个问题,请分享我的解决方案。先谢谢你了

构建失败

The following build commands failed:
    CompileSwift normal x86_64
    /Users/mac/Desktop/projects/personal_projects/ecommerce/agro_ecommerce_angular/node_modules/@capacitor/ios/Capacitor/Capacitor/AppUUID.swift
    (in target 'Capacitor' from project 'Pods')
    CompileSwift normal x86_64
    /Users/mac/Desktop/projects/personal_projects/ecommerce/agro_ecommerce_angular/node_modules/@capacitor/ios/Capacitor/Capacitor/Array+Capacitor.swift
    (in target 'Capacitor' from project 'Pods')
    CompileSwift normal x86_64
    /Users/mac/Desktop/projects/personal_projects/ecommerce/agro_ecommerce_angular/node_modules/@capacitor/ios/Capacitor/Capacitor/CapacitorBridge.swift
    (in target 'Capacitor' from project 'Pods')
    CompileSwift normal x86_64
    /Users/mac/Desktop/projects/personal_projects/ecommerce/agro_ecommerce_angular/node_modules/@capacitor/ios/Capacitor/Capacitor/Plugins/CapacitorCookieManager.swift
    (in target 'Capacitor' from project 'Pods')
    CompileSwift normal x86_64
    /Users/mac/Desktop/projects/personal_projects/ecommerce/agro_ecommerce_angular/node_modules/@capacitor/ios/Capacitor/Capacitor/Plugins/CapacitorCookies.swift
    (in target 'Capacitor' from project 'Pods')
    CompileSwift normal x86_64
    /Users/mac/Desktop/projects/personal_projects/ecommerce/agro_ecommerce_angular/node_modules/@capacitor/ios/Capacitor/Capacitor/CapacitorExtension.swift
    (in target 'Capacitor' from project 'Pods')
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'Capacitor' from project
    'Pods')
    (7 failures)

相关问题