【问题标题】:Flutter Firebase app runs fine in simulator but crashes when tested in testflightFlutter Firebase 应用程序在模拟器中运行良好,但在 testflight 中测试时崩溃
【发布时间】:2021-12-03 17:34:45
【问题描述】:

最近我加入了一个使用 firebase 的颤振应用程序的项目,在进行生产构建之前一切都很好。对于Android,它工作正常。但是对于 ios,我遇到了一个问题,它在模拟器中运行没有问题,但是当我将它上传到 Testflight 供我的同事测试时,它在打开时立即崩溃。

那是我的颤振医生-v:

[✓] Flutter (Channel unknown, 2.2.2, on macOS 11.2.3 20D91 darwin-x64, locale
    pt-BR)
    • Flutter version 2.2.2 at /Users/leonardofelix/flutter
    • Framework revision d79295af24 (4 months ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/leonardofelix/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      ???? https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      ???? https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.61.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.27.0

[✓] Connected device (2 available)
    • iPhone 12 Pro Max (mobile) • 94BE45CC-ED04-4892-B3A6-3F43D0A147AD • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • Chrome (web)               • chrome                               •
      web-javascript • Google Chrome 94.0.4606.81

还有 testflight 的测试人员发给我的崩溃报告:

crashlog.crash

我已经测试了一些我在谷歌上搜索到的东西,比如使用 xcode 再次添加 Google-Services.plist 并验证存档的架构是否指向发布模式。但它们都不起作用。

如果需要任何其他数据,我很乐意提供。所以提前感谢您的帮助。

【问题讨论】:

  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: ios firebase flutter


【解决方案1】:

好吧,我发现了错误。我使用 git 更改了 Flutter 版本(因此,Flutter 文件夹是一个 git 存储库)。当我更改版本时,它离开了其他 Flutter 版本的缓存,并且该缓存导致了问题。

帮助我发现这一点的一件事是使用 Xcode 在物理设备中运行发布版本;那里提示我以下错误:

初始化 Dart VM 时出错:错误的完整快照版本,应为 '9cf77f4405212c45daf608e1cd646852' 找到 'e4a09dbf2bb120fe4674e0576617a0dc'

为此,我在网上找到了解决方案。我所做的是删除<yourFlutterDir>/bin中的文件夹缓存,并在Flutter目录中运行以下命令:

git reset --hard
git clean -xffd
flutter doctor

然后,我转到我的 Flutter 项目文件夹,运行 flutter clean,最后运行 flutter build ios

所以项目构建成功,应用在 iOS 中运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-29
    相关资源
    最近更新 更多