【问题标题】:Can not run app after implementing pod 'Firebase/Firestore' in my iOS App在我的 iOS 应用程序中实施 pod 'Firebase/Firestore' 后无法运行应用程序
【发布时间】:2020-02-03 14:49:36
【问题描述】:

我正在尝试将 Firestore 添加到我的应用程序中,但它给了我这个错误:使用未声明的标识符 'SSL_get_secure_renegotiation_support';您的意思是“GRPC_SHADOW_SSL_get_secure_renegotiation_support”吗?

【问题讨论】:

  • 点击修复看看会发生什么
  • 关于工作区的构建设置的某些内容可能会干扰 grpc 搜索路径。

标签: ios swift xcode firebase google-cloud-firestore


【解决方案1】:

这里我给你带来一个临时解决方案。

The following lines of this file must be commented:
"/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h"

// #define SSL_CTX_set_tlsext_servername_callback \
// SSL_CTX_set_tlsext_servername_callback
// #define SSL_get_secure_renegotiation_support \
// SSL_get_secure_renegotiation_support

They can do it with a post processor that runs after the install pod:

public class DisableFirestoreSsl
    {
        [PostProcessBuild (51)]
        public static void Execute (BuildTarget buildTarget, string pathToBuiltProject)
        {
            if (buildTarget! = BuildTarget.iOS) return;
            var filePath = pathToBuiltProject + "/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h";
            File.SetAttributes (filePath, FileAttributes.Normal);
            var fileContent = File.ReadAllText (filePath);
            fileContent = DisableDirective (fileContent, "SSL_CTX_set_tlsext_servername_callback");
            fileContent = DisableDirective (fileContent, "SSL_get_secure_renegotiation_support");
            File.WriteAllText (filePath, fileContent);
        }

        private static string DisableDirective (string input, string directive)
        {
            return Regex.Replace (input, $ "# define {directive}. * \ n .. * {directive}", $ "// Disable {directive}");
        }
    }

【讨论】:

    【解决方案2】:

    “替换”有用吗?如果没有,卸载并重新安装你的 podfiles 可能是最好的选择(虽然它很烦人)。我遇到过类似的错误,对于为什么这是一个错误没有任何意义。 Uninstalling and reinstalling 每次都为我工作。

    【讨论】:

      猜你喜欢
      • 2021-08-01
      • 2019-06-03
      • 1970-01-01
      • 2021-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多