MissingPluginException(未在通道 com.tekartik.sqflite 上找到方法 openDatabase 的实现)

MissingPluginException(No implementation found for method openDatabase on channel com.tekartik.sqflite)

在 运行 flutter build ios 上遇到此错误。 flutter 构建后 Sqflite 未反映在 GeneratedPluginRestraints 文件中。 尝试了 flutter clean、pod update 等都没有用。 Flutter 版本 - 1.7.8 和 cocoapods 版本 - 1.6.1 pubspec.yaml 中的 sqflite 版本 - ^1.6.1 中的依赖项覆盖

flutter doctor -v 输出-

[✓] Flutter (Channel unknown, v1.7.8, on Mac OS X 10.14.5 18F132, locale en-GB)
    • Flutter version 1.7.8 at /Users/oyo/Downloads/flutter
    • Framework revision d51fd86cdb (6 months ago), 2019-06-21 22:31:55 -0400
    • Engine revision d004bcd4d6
    • Dart version 2.4.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/oyo/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /Users/oyo/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b01)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.1, Build version 11A1027
    • CocoaPods version 1.6.1

[✓] iOS tools - develop for iOS devices
    • ios-deploy 1.9.4

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

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 37.1.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.1.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 37.0.3
    • Dart plugin version 191.7830

[✓] IntelliJ IDEA Community Edition (version 2019.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 37.1.4
    • Dart plugin version 192.5728.98

[✓] Connected device (2 available)
    • macOS • macOS • darwin-x64     • Mac OS X 10.14.5 18F132
    • web   • web   • web-javascript • Google Chrome 79.0.3945.88 

只需在 IDE 的终端中输入 运行 命令,

flutter doctor --android-licenses

有些 android SDK 许可证不被接受。所以写上面的命令会要求你使用不同的许可证来接受 y/n 选项。接受所有这些以继续您的工作流程。