Xcode 13 mac m1 芯片 google signin build 为 iOS 模拟器提供构建,但链接到为 iOS 构建的目标文件

Xcode 13 mac m1 chip google signin build gives building for iOS Simulator,but linking in object file built for iOS

我用这个插件@codetrix-studio/capacitor-google-auth

并且我在 ANDROID 中一一执行所有步骤但当我为 IOS 构建时 它打开 Xcode 但是当我 运行 目标应用程序时它给我这个错误

in APP_PATH/ios/App/Pods/GoogleSignIn/Frameworks/GoogleSignIn.
framework/GoogleSignIn(GIDEMMErrorHandler_3a47e13d8ca81b41e9cdb7ef5468004a.o),
building for iOS Simulator,but linking in object file built for iOS, file 
'APP_PATH/ios/App/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn' 
for architecture arm64

试试这个

您必须将此代码添加到您的 Podfile

post_install do |installer|
 installer.pods_project.build_configurations.each do |config|
  config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
 end
end

添加此代码后安装 pod

pod install

并在 capacitor.config.json

中添加此代码
"GoogleAuth": {
        "scopes": [
            "profile",
            "email"
        ],
        "serverClientId": "YOUR_API_KEY.apps.googleusercontent.com",
        "forceCodeForRefreshToken": true
    }

并在 Xcode

添加关键清理项目和 运行 之后。

并在 Building Settings 中添加 arm64 并找到 Excluded Architecture