2

I have an app that uses SQLCipher to read and write to crypted databases.

Wanting to use Firebase, I stumbled upon 2 problems:

Firstly, some ... thing added -l"sqlite3" to my Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig (and release too, ofc). Because of this, my app's SQLs were failing with error file is encrypted or is not a database.

I solved this by adding a post_install to my Podfile that removes those from all config files.

After doing this, a Firebase SQL started failing with error no such table: s2dRmqIds.

AFAIK, there is no way to use SQLite and SQLCipher in the same project, as they are complementary.

Any idea what is Firebase trying to save in that table? Or how much of a problem is? Or if I can change the storing mechanism? Or if it is a (known) bug?

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113

2 Answers2

1

I create a post install script that remove the -l"sqlite3" other linker flag from firebase pods and it helps!

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      xcconfig_path = config.base_configuration_reference.real_path
      xcconfig = File.read(xcconfig_path)
      new_xcconfig = xcconfig.gsub('-l"sqlite3"', '')
      File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
    end
  end
end
0

Had a same issue, after several hours, found a [SOLUTION]!

enter image description here

  • Go to Project Build Settings
  • Search for Other Linker Flags
  • add line -framework SQLCipher

And that's it!)

Now Firebase and SQLCipher will live together happy.

Anton Eregin
  • 8,140
  • 1
  • 12
  • 14