Flutter_cached_network_image: Failed to build iOS due to sqflite transitive dependency

Created on 3 Nov 2020  ·  7Comments  ·  Source: Baseflow/flutter_cached_network_image

🐛 Bug Report

Currently I added the cached_network_image: ^2.3.3 to my project dependencies and now iOS build is failing with:

error: the following command failed with exit code 0 but produced no further output
    CompileC /Users/myuser/Library/Developer/Xcode/DerivedData/Runner-adczpfoxmrmmcrenpvwevoumfynr/Build/Intermediates.noindex/Pods.build/Release-iphoneos/FMDB.build/Objects-normal/arm64/FMDatabase.o /Users/myuser/builds/ErPwZgwM/0/axonstream/axon-pos-flutter/ios/Pods/FMDB/src/fmdb/FMDatabase.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    /Users/myuser/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.1+2/ios/Classes/SqflitePlugin.m:3:9: fatal error: 'fmdb/FMDB.h' file not found
    #import <fmdb/FMDB.h>
            ^~~~~~~~~~~~~
    1 error generated.

I checked my project and the only dependency that uses sqflite as transitive dependency is cached_network_image, if I remove cached_network_image from my dependencies then transitive sqflite is removed also from pubspec.lock... and iOS build is successful.

Expected behavior

The iOS build should build successful.

Reproduction steps

Just added the cached_network_image: ^2.3.3 dependency to my project and iOS build starts failing.

Flutter Doctor

[✓] Flutter (Channel beta, 1.22.1, on Mac OS X 10.15.5 19F101, locale en-US)
• Flutter version 1.22.1 at /Users/myuser/Flutter/SDK
• Framework revision f30b7f4db9 (4 weeks ago), 2020-10-08 10:06:30 -0700
• Engine revision 75bef9f6c8
• Dart version 2.10.1

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/myuser/Android/SDK
• Platform android-30, build-tools 29.0.3
• ANDROID_HOME = /Users/myuser/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_202-release-1483-b49-5587405)
• All Android licenses accepted.

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

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

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

Version: 2.3.3

Platform:

  • [x] :iphone: iOS
  • [ ] :robot: Android
triage

Most helpful comment

Force the 'platform' on my ios/Podfile worked for me.

platform :ios, '9.0'

All 7 comments

I also have a doubt here, why use sqflite? it wouldn't be better/faster/simpler to use a no sql storage like Hive

Could you maybe try pub upgrade?

Could you maybe try pub upgrade?

Yes I've done it, in fact was the first thing I did when I get the first fail... but the fail remains the same

I also did manual:
pod install
pod repo update
and still failing.

Same here

Force the 'platform' on my ios/Podfile worked for me.

platform :ios, '9.0'

@diegoalex you fixed my issue with this thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gavin-1991 picture Gavin-1991  ·  6Comments

creativecreatorormaybenot picture creativecreatorormaybenot  ·  4Comments

digitaldangal picture digitaldangal  ·  5Comments

nashfive picture nashfive  ·  5Comments

anass-naoushi picture anass-naoushi  ·  5Comments