You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter集成recaptcha_enterprise_flutter遇无效包错误,求解决方案

使用recaptcha_enterprise_flutter 18.4.2版本时initClient()触发无效包错误求助

我正在使用18.4.2版本的recaptcha_enterprise_flutter包,想要在应用中实现reCAPTCHA功能,参考了官方示例仓库。但调用initClient()方法时出现了无效包错误,错误截图如下:

错误截图

相关代码如下:

void initClient() async {
  String siteKey = Platform.isAndroid
      ? widget.config.androidSiteKey
      : widget.config.iosSiteKey;

  var result = false;
  var errorMessage = "failure";

  try {
    result = await RecaptchaEnterprise.initClient(siteKey, timeout: 10000);
  } on PlatformException catch (err) {
    debugPrint('Caught platform exception on init: $err');
    errorMessage = 'Code: ${err.code} Message ${err.message}';
  } catch (err) {
    debugPrint('Caught exception on init: $err');
    errorMessage = err.toString();
  }

  setState(() {
    _clientState = result ? "ok" : errorMessage;
  });
}

请问有开发者遇到过这个问题吗?


内容的提问来源于stack exchange,提问作者E. Biagi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 20:42:04