美文网首页
Flutter 报错:Undefined symbols for

Flutter 报错:Undefined symbols for

作者: djyuning | 来源:发表于2021-10-04 23:17 被阅读0次

    最近 Flutter SDK 升级到 2.5.1,xcode 执行构建时,很多包都报不支持,把所有的包升级到最新版后错误逐渐减少。最后构建时,只有 fluwx 报 “Undefined symbols for architecture arm64” 的错误。

    报错信息大概如下:

    ld: in ____PATH____/ios/Pods/WechatOpenSDK_Fuck/OpenSDK1.9.2/libWeChatSDK.a(WechatAuthSDK.o), building for iOS Simulator, but linking in object file built for iOS, file '____PATH____/ios/Pods/WechatOpenSDK_Fuck/OpenSDK1.9.2/libWeChatSDK.a' for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    各方排查后,处理方式如下:

    打开 ios 工程下的 Podfile 文件,修改 post_install do |installer| 部分的代码:

    # 其余代码略
    
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
        target.build_configurations.each do |config|
          config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
        end
      end
    end
    

    再次执行构建即可成功!

    参考:https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-an-object-file-built-for-io

    相关文章

      网友评论

          本文标题:Flutter 报错:Undefined symbols for

          本文链接:https://www.haomeiwen.com/subject/aulwnltx.html