美文网首页
SQLCipher 在 Cocoapods 1.5+ 引入的报错

SQLCipher 在 Cocoapods 1.5+ 引入的报错

作者: ZyonPaul | 来源:发表于2018-06-07 09:16 被阅读94次

在升级了Cocoapods 到 1.5 以后, pod install 后, 编译报错:

Implicit declaration of function ‘sqlite3_key’ is invalid in C99
Implicit declaration of function ‘sqlite3_rekey’ is invalid in C99

但 Other Link Flag 之类的都已经设置好了, 仍然报错, 最终找到解决方案如下:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'testPodFMDB' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!
    
    # Pods for testPodFMDB
    pod 'FMDB/SQLCipher'
    
    post_install do |installer|
        installer.pods_project.targets.each do |target|
            if target.name == "FMDB"
                config_path = target.build_configurations[0].base_configuration_reference.real_path
                File.open(config_path, "a") {|file| file.write("HEADER_SEARCH_PATHS = SQLCipher")}
            end
        end
    end
    
end

具体细节请参照:
https://discuss.zetetic.net/t/ios-11-xcode-issue-implicit-declaration-of-function-sqlite3-key-is-invalid-in-c99/2198

相关文章

网友评论

      本文标题:SQLCipher 在 Cocoapods 1.5+ 引入的报错

      本文链接:https://www.haomeiwen.com/subject/utpwsftx.html