Search code examples
iosfluttercocoapodssqflite

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


Facing this error on running flutter build ios. Sqflite is not reflected in the GeneratedPluginRestraints file after flutter build. Tried flutter clean, pod update etc nothing works. Flutter version - 1.7.8 and cocoapods version - 1.6.1 sqflite version in pubspec.yaml - ^1.6.1 in dependency overrides

flutter doctor -v output -

[✓] 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 

Solution

  • Just run command in your IDE's terminal,

    flutter doctor --android-licenses
    

    There are some android SDK licenses are not accepted. So writing above command will ask you with different licenses to accept with y/n options. Accept all of them to continue your work flow.