flutter iOS 项目中的 pod install 给出了 base64: invalid input

2023-12-26

经过一段时间的停机后,我尝试为 iOS 构建 Flutter 应用程序,但没有成功。pod intall给我以下输出(即使在清理 XCode 工作区之后):

$ pod install
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_analytics: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
Warning: firebase_app_id_file.json file does not exist. This may cause issues in upload-symbols. If this error is unexpected, try running flutterfire configure again.
firebase_crashlytics: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_dynamic_links: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_remote_config: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_storage: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
Downloading dependencies
Installing AppAuth (1.5.0)
Installing BoringSSL-GRPC (0.0.24)
[!] /opt/homebrew/bin/bash -c
set -e
set -e
# Add a module map and an umbrella header
mkdir -p src/include/openssl
cat > src/include/openssl/umbrella.h <<EOF
  #include "ssl.h"
  #include "crypto.h"
  #include "aes.h"
  /* The following macros are defined by base.h. The latter is the first file included by the
     other headers. */
  #if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)
  #  include "arm_arch.h"
  #endif
  #include "asn1.h"
  #include "asn1_mac.h"
  #include "asn1t.h"
  #include "blowfish.h"
  #include "cast.h"
  #include "chacha.h"
  #include "cmac.h"
  #include "conf.h"
  #include "cpu.h"
  #include "curve25519.h"
  #include "des.h"
  #include "dtls1.h"
  #include "hkdf.h"
  #include "md4.h"
  #include "md5.h"
  #include "obj_mac.h"
  #include "objects.h"
  #include "opensslv.h"
  #include "ossl_typ.h"
  #include "pkcs12.h"
  #include "pkcs7.h"
  #include "pkcs8.h"
  #include "poly1305.h"
  #include "rand.h"
  #include "rc4.h"
  #include "ripemd.h"
  #include "safestack.h"
  #include "srtp.h"
  #include "x509.h"
  #include "x509v3.h"
EOF
cat > src/include/openssl/BoringSSL.modulemap <<EOF
  framework module openssl {
    umbrella header "umbrella.h"
    textual header "arm_arch.h"
    export *
    module * { export * }
  }
EOF

# To avoid symbol conflict with OpenSSL, gRPC needs to rename all the BoringSSL symbols with a
# prefix. This is done with BoringSSL's BORINGSSL_PREFIX mechanism
# (https://github.com/google/boringssl/blob/75148d7abf12bdd1797fec3c5da9a21963703516/BUILDING.md#building-with-prefixed-symbols).
# The required prefix header file boringssl_prefix_symbols.h is not part of BoringSSL repo at
# this moment. It has to be generated by BoringSSL's users and be injected to BoringSSL build.
# gRPC generates this file in script /tools/distrib/upgrade_boringssl_objc.sh. This script
# outputs a gzip+base64 encoded version of boringssl_prefix_symbols.h because of Cocoapods'
# limit on the 'prepare_command' field length. The encoded header is generated from
# /src/boringssl/boringssl_prefix_symbols.h. Here we decode the content and inject the header to
# the correct location in BoringSSL.
case "$(uname)" in
  Darwin) opts="" ;;
       *) opts="--ignore-garbage" ;;
esac
base64 --decode $opts <<EOF | gunzip > src/include/openssl/boringssl_prefix_symbols.h
  *** SNIP: long base 64 string ***
EOF

# We are renaming openssl to openssl_grpc so that there is no conflict with openssl if it exists
find . -type f \( -path '*.h' -or -path '*.cc' -or -path '*.c' \) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <openssl/;#include <openssl_grpc/;g'

# Include of boringssl_prefix_symbols.h does not follow Xcode import style. We add the package
# name here so that Xcode knows where to find it.
find . -type f \( -path '*.h' -or -path '*.cc' -or -path '*.c' \) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <boringssl_prefix_symbols.h>;#include <openssl_grpc/boringssl_prefix_symbols.h>;g'

base64: invalid input
gunzip: (stdin): unexpected end of file

如果我从上面的输出中复制 base64 字符串并运行它base64 --decode我确实遇到了同样的错误(无效输入”:

cat base64.txt | base64 --decode
�boringssl_prefix_symbols.h��]s۸�h��W��ܩ:5;�n�base64: invalid input

我不知道这是否是我的环境、cocoapods、BoringSSL-GRPC 或依赖它的东西的问题(可能是 firebase 包之一?)。如果有人有任何指示,我将非常感激。

环境硬件:Mac mini M1 Cocoapods:来自 Homebrew 的 1.11.3 颤医生:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.1, on macOS 12.4 21F79 darwin-arm, locale en-SE)
[✗] Android toolchain - develop for Android devices
    ✗ ANDROID_HOME = /Users/tjarvstrand/Android/Sdk
      but Android SDK not found at this location.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.1)
[!] Android Studio
    ✗ Unable to find bundled Java version.
[✓] IntelliJ IDEA Community Edition (version 2021.3.3)
[✓] VS Code (version 1.67.2)
[✓] VS Code (version 1.66.2)
[✓] Connected device (1 available)
[✓] HTTP Host Availability

! Doctor found issues in 3 categories.

经过一番彻底的挖掘,结果发现这是因为我的系统上安装了 GNU coreutils,所以安装时使用了不兼容的 base64 命令。

编辑:为了澄清,我的PATH设置了环境变量,以便base64调用该命令的 GNU 版本,该命令不喜欢 Cocapods 传递的输入参数。我通过改变我的问题解决了PATH使得系统base64相反,命令被调用。不确定它们在这种情况下如何/为什么不兼容,但这解决了我的问题。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

flutter iOS 项目中的 pod install 给出了 base64: invalid input 的相关文章

  • 在iOS中设置框架的原点

    我正在尝试以编程方式设置框架的原点 Method1 button frame origin y 100 方法二 CGRect frame button frame frame origin y 100 我尝试了方法 1 但它不起作用 显示错
  • Android - API 请求

    我开发了一个应用程序 它也在 iPhone 上 问题出在 api 请求上 我为所有请求设置了超时 有时会出现 30 60 秒的中断 看起来这个应用程序执行了几个请求 然后就中断了 一直超时 大约 45 秒后一切正常 不知道是服务器问题还是安
  • skView.ignoreSiblingOrder 在 swift 中的重要性/效率?

    这样做有多重要 高效skView ignoreSiblingOrder true初始化场景时 现在 我将其设置为 true 但由于某种原因 当我从 MainMenu 场景启动 GameScene 时 它 会在我的角色之前加载背景 即使背景的
  • 当自定义子视图处理触摸时防止 UITableView 滚动

    在我的 iOS 应用程序中 有一个 UITableView 其中一个单元格中包含一个自定义子视图 该单元格是一个交互式视图 它处理触摸事件 touchesBegan touchesEnded touchesMoved 以更新自身 问题是 当
  • 检查系统时间是自动还是用户设置

    我需要在当前的项目中设置用户证明时间 我围绕这个问题发现了很多不同的问题 但似乎没有一个问题有我正在寻找的答案 这些是我到目前为止看过的问题 XCODE 如何从设备获取 验证准确的时间戳 https stackoverflow com qu
  • SwiftUI - 预览时未知的预览提供程序“ContentView_Previews_”。发生在一个全新的项目中

    我有这个简单的观点 import SwiftUI struct ContentView View var body some View Text Hello struct ContentView Previews PreviewProvid
  • 有没有办法阻止 iOS 上的 Safari 在关闭时清除网站的 cookie?

    我的移动网络应用程序的一位用户抱怨说 每次他关闭手机屏幕后使用该应用程序时 他都必须重新登录该应用程序 发生的情况是 当屏幕关闭时 或者当您通过双击主页按钮并滑开 Safari 来完全关闭 Safari 时 Safari 会清除该网站的 C
  • 如何更改便携式 xamarin ios 项目中的启动屏幕?

    我正在使用便携式 xamarin 形式 其中项目是 IOS 项目 在 IOS 项目中 我想创建闪屏 我在 ios 项目属性中添加了 Iphone 启动图像和 iPad 启动图像 当我运行该应用程序时 它显示默认的启动屏幕 我还尝试从 inf
  • iOS 解析如何通过 URL 下载文件

    我正在将 parse 用于我的聊天应用程序 当我上传文件时 我保留该 url 并将该 url 发送给其他用户 然后其他用户可以通过该 URL 下载文件 这是我上传文件的代码 void uploadBlob NSData blob fileN
  • iOS 11 浮动 TableView 标题

    有一个应用程序包含多个部分 展开 时每个部分有几行 折叠 时没有 每个部分都有一个部分标题 使用以下子类重用它们UITableViewHeaderFooterView等等 到目前为止一切顺利 然后在 iOS 11 中 我使用了可视化调试器
  • ShareKit + Facebook 身份验证不起作用

    我正在使用 ShareKit 从我正在开发的 PhoneGap 应用程序发布到 Facebook 我在 Facebook 中创建了该应用程序 并在我的项目中安装了该插件 Twitter 工作正常 但当我尝试在 Facebook 上分享时出现
  • 将语音添加到自定义 UIMenuController

    我创建了一个自定义UIMenuController in a UIWebView但它似乎摆脱了 说出选择 选项UIMenuController在那之后 所有测试设备上的 偏好设置 中都打开了发言选择选项 并且它出现在其他应用程序中 包括非
  • iOS NSURLSession,如何在didCompleteWithError中重试

    我想在我的服务器上尝试一次调用 直到成功为止 我想每 30 秒尝试一次 所以我使用 NSURLSession 进行通话 NSURLSessionDownloadTask task self session downloadTaskWithR
  • CocoaPods podspec 与每个架构标志

    快速版本 我有一个代码库 正在为其创建 Cocoapods 规范文件 根据体系结构 它需要不同的编译器标志 那可能吗 说明背景 该库的文件之一包含一些 ARM NEON 内在函数代码 对于armv7和armv7s 标志是 s compile
  • 如何在flutter项目中使用http拦截器?

    我必须向我的所有 Api 添加标头 有人告诉我为此使用 http 拦截器 但我无法理解如何做到这一点 因为我是颤振的新手 谁能帮我举个例子吗 您可以使用http 拦截器 https pub dev packages http interce
  • 如何在 Swift 中创建 UIAlertView?

    我一直在努力在 Swift 中创建 UIAlertView 但由于某种原因我无法得到正确的语句 因为我收到此错误 找不到接受提供的 init 重载 论点 我是这样写的 let button2Alert UIAlertView UIAlert
  • 由于 2.23 导致 iOS 应用程序被拒绝 - iOS 数据存储指南

    以下是 Apple 关于拒绝的消息 2 23 应用程序必须遵循 iOS 数据存储指南 否则将被拒绝 2 23 详情 在启动和内容下载时 您的应用程序会存储 6 5 MB 这并不意味着 遵守 iOS 数据存储指南 下一步 请验证只有用户使用您
  • 使用 nib 作为带有 nib 类的表节标题

    我想创建一个加载 nib 文件并将其设置为标题 UIView 的节标题 这个 nib 文件还将有一个关联的类 其中插座和操作连接到 因此我想像平常一样使用 nib 加载该类 我在网上搜索并找到了几个类似的答案 但我找不到任何适合我的答案 经
  • 使用 UItableViewCell 类型的表达式初始化“CustomCellView *”的指针类型不兼容

    你能帮我理解和 修复下面的错误吗 我不明白CustomCellView是一个子类UItableViewCell 代码已编译 但警告仍然存在 Incompatible pointer type initializing CustomCellV
  • iOS 13 检查 CLLocationManager 的临时授权状态

    根据 WWDC 视频 https developer apple com videos play wwdc2019 705 https developer apple com videos play wwdc2019 705 当你要求 Al

随机推荐