fmdb icon indicating copy to clipboard operation
fmdb copied to clipboard

run on Xcode9

Open furueili opened this issue 8 years ago • 6 comments

2017-09-20 2 34 52

just update Xcode9 and found this issue please help thx

furueili avatar Sep 20 '17 06:09 furueili

H @furueili ! Fmdb does not support xcode9 + ios11 yet. I'm waiting fix too.

mezhevikin avatar Sep 20 '17 14:09 mezhevikin

Are you using Cocoapods to include FMDB in your project, and are you also attempting to use SQLCipher? If so, you may find this helpful:

https://discuss.zetetic.net/t/ios-11-xcode-issue-implicit-declaration-of-function-sqlite3-key-is-invalid-in-c99/2198/27

The error suggests sqlite3.h is not in your header search paths (or, that the sqlite3.h that is being used is not the SQLCipher version including the symbols sqlite3_key, sqlite3_rekey, etc)

billymeltdown avatar Sep 20 '17 14:09 billymeltdown

hi @billymeltdown . Thank you for answer. Yes, i use SQLCipher. I tried it hack, and application was compiled. But i'm getting crash:

libc++abi.dylib: terminating with uncaught exception of type NSException

My podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

abstract_target 'defaults' do
    pod 'SQLCipher', :inhibit_warnings => true
    pod 'FMDB/SQLCipher', :git => 'https://github.com/ccgus/fmdb'
    target 'DB'
    target 'Example'
end

post_install do | installer |
    print "SQLCipher: link Pods/Headers/sqlite3.h"
    system "mkdir -p Pods/Headers/Private && ln -s ../../SQLCipher/sqlite3.h Pods/Headers/Private"
end

mezhevikin avatar Sep 20 '17 14:09 mezhevikin

@billymeltdown thk. Hack works fine! It was problem of my code.

mezhevikin avatar Sep 20 '17 21:09 mezhevikin

Unfortunately, this post_install hook no longer seems to do the trick with the latest version of cocoa pods and Xcode. This post_install hook to add SQLCipher to the HEADER_SEARCH_PATHS of FMDB should do the trick now:

post_install do |installer|
        installer.pods_project.targets.each do |target|
            if target.name == "FMDB"
               target.build_configurations.each do |config|
                   header_search = {"HEADER_SEARCH_PATHS" => "SQLCipher"}
                   config.build_settings.merge!(header_search)
               end
            end
        end
    end

I've issued a PR which should hopefully accomplish the same thing as this post_install hook within the SQLCipher subspec of the podspec.

R4N avatar May 17 '18 14:05 R4N

https://github.com/ccgus/fmdb/commit/18152d3ea819d5a65a682ad9f3b22dbbb3c2423e was merged in with the adjustment to the SQLCipher subspec

That should resolve this issue and no longer require the post_install hook workaround

R4N avatar May 22 '18 20:05 R4N