颤振:错误:找不到吸气剂:'挂起'。案例AppLifecycleState.suspending


9

尝试在本地iOS模拟器上启动应用程序时,我刚刚在稳定通道上升级了Flutter并获得了以下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.

扑医生-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!

有人有解决办法吗?

Answers:


9

我遇到过同样的问题。

请查看native_device_orientation软件包的变更日志:

“进行了重大更改以支持AppLifecycleState.suspended已更改为AppLifecycleState.detached的事实。”

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

对我来说是qr_mobile_vision。


我没有使用您链接的任何软件包,但仍然收到此错误。有任何想法吗?
— altShiftDev

没关系,找到原因并提交了新答案。
— altShiftDev

5

为了使答案的范围比@ x23b5提交的答案的范围略宽,这确实是由11月4日进入Flutter 主频道的PR引起的。

公关将枚举:更新AppLifecycleState.suspending为AppLifecycleState.detached。

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

另一方面,如果您已经手动编写了利用AppLifecycleState的代码(例如我的案例),请在代码中进行搜索,然后手动将挂起状态更新为分离状态并重新启动flutter。


您节省了时间,这个问题让我筋疲力尽。
— Bipin Vayalu

0

有同样的问题。将qr_mobile_vision更新到版本0.3.1似乎已解决了该问题。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.