【问题标题】:Flutter build iOS - BoringSSL-GRPC/, undeclared 'SSL_get_secure_renegotiation_support'; 'GRPC_SHADOW_SSL_get_secure_renegotiation_support'?Flutter 构建 iOS - BoringSSL-GRPC/,未声明的 'SSL_get_secure_renegotiation_support'; 'GRPC_SHADOW_SSL_get_secure_renegotiation_support'?
【发布时间】:2021-01-11 06:14:07
【问题描述】:

在尝试为 Firebase Auth 运行基本 Flutter 演示时,遇到此错误输出:

error: use of undeclared identifier
'SSL_get_secure_renegotiation_support'; did you mean 'GRPC_SHADOW_SSL_get_secure_renegotiation_support'?
      !(SSL_get_secure_renegotiation_support(ssl) &&
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        GRPC_SHADOW_SSL_get_secure_renegotiation_support

我采取的步骤,但仍然是同样的错误:

  1. 运行flutter clean
  2. 运行flutter build ios
  3. 按照此帖子中pod update 的步骤操作:https://stackoverflow.com/a/59073131/2162226

完整的错误输出:

Running pod install...                                             20.8s
Running Xcode build...                                                  
(This is taking an unexpectedly lon                                                   
Xcode build done.                                           346.8s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳

/Users/gene/git/flutter_wifi/ios/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc:3319:9: error: use of undeclared identifier
'SSL_get_secure_renegotiation_support'; did you mean 'GRPC_SHADOW_SSL_get_secure_renegotiation_support'?
      !(SSL_get_secure_renegotiation_support(ssl) &&
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        GRPC_SHADOW_SSL_get_secure_renegotiation_support
In file included from /Users/gene/git/flutter_wifi/ios/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc:109:
/Users/gene/git/flutter_wifi/ios/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h:4662:5: note: expanded from macro
'SSL_get_secure_renegotiation_support'
    SSL_get_secure_renegotiation_support
    ^
/Users/gene/git/flutter_wifi/ios/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h:1590:20: note:
'GRPC_SHADOW_SSL_get_secure_renegotiation_support' declared here
OPENSSL_EXPORT int SSL_get_secure_renegotiation_support(const SSL *ssl);
                   ^
In file included from <built-in>:1:
/Users/gene/git/flutter_wifi/ios/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-prefix.pch:2489:46: note:
expanded from macro 'SSL_get_secure_renegotiation_support'
#define SSL_get_secure_renegotiation_support GRPC_SHADOW_SSL_get_secure_renegotiation_support

【问题讨论】:

    标签: ios xcode flutter


    【解决方案1】:

    运行这组命令,其中pod命令从&lt;flutterProject&gt;\ios运行:

    rm -rf ~/Library/Developer/Xcode/DerivedData/
    rm -rf ~/Library/Caches/CocoaPods/
    pod deintegrate
    pod update
    

    感谢发帖:https://stackoverflow.com/a/63997424/2162226

    这样做之后,再运行flutter build ios,就不会出现OP中描述的错误了。

    另一个差异 - 虽然不确定是否相关,但这些更改正在应用于 SSD 驱动器,自 OP 以来从标准硬盘驱动器升级。

    请注意,屏幕截图中的 pod 更新包含这一行 Installing BoringSSL-GRPC (0.0.7) ,我想知道这是否实际上解决了问题。

    【讨论】:

      【解决方案2】:

      关于变通解决方案的更新

      我正在 Mac Mini 上运行构建,这可能需要 10 分钟才能完成手头代码的构建。当我运行flutter clean 时,它会重新生成ssl.h 文件,因此需要再次注释掉这两行。

      有一个“智能”文本编辑器打开代码,文本编辑器会在文件系统发生更改时向您显示(例如,Sublime),我可以看到这些行没有注释一旦flutter build ios 开始。当我看到这一点时,我可以再次注释掉这些行,显然如果我及时这样做,构建将成功完成。在我让每个flutter clean 之后的构建失败之前,然后注释掉这些行。它确实增加了构建时间,所以这个额外的考虑有助于解决这里的问题。

      【讨论】:

        【解决方案3】:

        您可以暂时在下面的行中发表评论:ios/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
        

        并重建它应该可以工作。这似乎是 firebase 问题,但我还没有找到永久的解决方案......

        【讨论】:

        猜你喜欢
        • 2022-08-09
        • 1970-01-01
        • 2020-08-19
        • 1970-01-01
        • 2021-04-11
        • 2021-11-24
        • 2020-08-09
        • 1970-01-01
        • 2012-06-12
        相关资源
        最近更新 更多