颤振:错误:找不到 Getter:“暂停”。案例 AppLifecycleState.suspending

Max*_*Max 12 iphone dependencies ios flutter flutter-dependencies

我刚刚在稳定频道上升级了 Flutter,并在尝试启动应用程序(在本地 iOS 模拟器上)时获得了以下 StackTrace。运行单元测试flutter test也会受到影响。

Launching lib/main.dart on iPhone 8 in debug mode...

Compiler message:
../../flutter/.pub-cache/hosted/pub.dartlang.org/native_device_orientation-0.1.2/lib/native_device_orientation.dart:149:30: Error: Getter not found: 'suspending'.
      case AppLifecycleState.suspending:
                             ^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
Failed to build bundle.
Error launching application on iPhone 8.
Run Code Online (Sandbox Code Playgroud)

颤振医生 -v

[?] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.6 18G1012, locale de-DE)
    • Flutter version 1.12.13+hotfix.5
    • Framework revision 27321ebbad (33 hours ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0


[?] Android toolchain - develop for Android devices (Android SDK version 29.0.0-rc2)
    • Android SDK at ...Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0-rc2
    • Java binary at: .../bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[?] Xcode - develop for iOS and macOS (Xcode 11.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3, Build version 11C29
    • CocoaPods version 1.6.0

[?] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[?] Connected device (1 available)
    • iPhone 8 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

• No issues found!
Run Code Online (Sandbox Code Playgroud)

有人有解决方案吗?

x23*_*3b5 10

我遇到过同样的问题。

请查看 native_device_orientation 包的更新日志:

“支持 AppLifecycleState.suspended 已更改为 AppLifecycleState.detached 的重大更改。”

你的一个包可能依赖于这个库。在这里您可以找到软件包列表https://pub.dev/packages?q=dependency%3Anative_device_orientation

对我来说是 qr_mobile_vision。


alt*_*Dev 6

为了使答案的范围比@x23b5 已经提交的答案更广泛一些,确实是由于这个PR于 11 月 4 日进入 flutter master 频道引起的。

PR 将 enum: 更新AppLifecycleState.suspendingAppLifecycleState.detached.

您可能在依赖此枚举的插件之一中使用依赖项,例如其中之一- 在这种情况下,您的调试错误消息会将您指向该插件 - 然后只需访问其 github 存储库并查看作者是否已发布修补。如果没有,请随意编辑该行并为他们提交 PR。

另一方面,如果您手动编写了利用 AppLifecycleState 的代码(如我的情况),请搜索您的代码并手动将挂起更新为分离并重新启动颤振。