[firebase_app_check]: iOS Swift package always embeds the closed-source reCAPTCHA Enterprise SDK, even when the app never uses AppleReCaptchaProvider

未关闭
#18,980 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

@moosyroot 已经在做这个了。

开始于 2026年11月18日。

  • #18981 来自 @moosyroot —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
firebase, flutter, swift

调研方向

Start by comparing the iOS Package.swift dependency and target product links with the CocoaPods podspec; the issue identifies the reCAPTCHA Enterprise package and product. Read the linked change #18261 and the native Firebase SDK’s optional-linking behavior described in the issue. Done means apps using other Apple providers can build without the reCAPTCHA binary, while selecting AppleReCaptchaProvider without its SDK reports an error instead of crashing; an open pull request #18981 is already linked.

由索引模型根据 Issue 内容生成。

描述

Needs Attention platform: ios plugin: app_check reproduced type: bug
Is there an existing issue for this?
  • I have searched the existing issues.
Which plugins are affected?

App Check

Which platforms are affected?

iOS

Description

Since #18261 the iOS Package.swift of firebase_app_check unconditionally depends on
https://github.com/GoogleCloudPlatform/recaptcha-enterprise-mobile-sdk.git and links its
RecaptchaEnterprise product into the plugin target:

.package(
  url: "https://github.com/GoogleCloudPlatform/recaptcha-enterprise-mobile-sdk.git",
  from: "18.0.0"
),
...
.product(name: "RecaptchaEnterprise", package: "recaptcha-enterprise-mobile-sdk"),

With Swift Package Manager (the default for iOS on current Flutter), every app that depends
on firebase_app_check therefore ships RecaptchaEnterpriseSDK.xcframework (a prebuilt,
closed-source binary downloaded from dl.google.com; 18.9.1 at the time of writing) inside
Runner.app/Frameworks, including apps that only activate AppleAppAttestProvider,
AppleDeviceCheckProvider or AppleDebugProvider.

The CocoaPods podspec does not add this SDK, so the two integrations behave differently,
and there is no way for an SPM app to opt out short of vendoring the plugin.

Why it matters for apps that do not use reCAPTCHA on iOS:

  • an extra closed-source binary, with its own privacy manifest and license terms, has to be
    reviewed and listed in the app's third-party notices;
  • larger app size;
  • App Store privacy disclosures may need to account for an SDK the app never calls.

The native Firebase SDK already treats the reCAPTCHA Enterprise SDK as optional:
FIRRecaptchaProvider checks at runtime whether RecaptchaEnterprise.RCARecaptcha is linked
(AppCheckRecaptchaProvider.isSupported() in google/app-check).

Reproducing the issue
  1. flutter create app && cd app && flutter pub add firebase_core firebase_app_check
  2. Activate App Check with providerApple: const AppleAppAttestProvider() only.
  3. flutter build ios --release --no-codesign
  4. find build/ios/Release-iphoneos/Runner.app -iname '*recaptcha*' lists
    Frameworks/RecaptchaEnterpriseSDK.framework.
Expected behavior (part of Description)

Apps that do not use AppleReCaptchaProvider can build without the reCAPTCHA Enterprise SDK,
e.g. through a build-time switch like FIREBASE_ANALYTICS_WITHOUT_ADID in
firebase_analytics.

Firebase Core version

5.1.0

Flutter Version

3.47.4

Relevant Log Output

Not applicable (build output, no runtime error).

Flutter dependencies

Paste flutter pub deps -- --style=compact from the minimal repro app when filing.

Additional context and comments

A related crash exists today on CocoaPods: selecting AppleReCaptchaProvider without adding
the RecaptchaEnterprise pod makes RecaptchaProvider(app:siteKey:) raise an Objective-C
NSInternalInconsistencyException from the plugin's configure, instead of reporting an
error. I can send a PR covering both.

主要语言
Dart
星标
9.3k
派生
4.1k
平均合并
4 天 17 小时
30 天内合并 PR
49

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/flutterfire 的其他 Issue

查看 firebase/flutterfire 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。