Good day.

There is an ios swift application that uses sqlite3 for data storage.

To this application, I screwed SQLCipher to work with an encrypted database, I did the integration through cocaopods ( https://cocoapods.org/pods/SQLCipher ). Everything works perfectly.

The problem begins when I integrate the appliance from Yandex ( https://github.com/yandexmobile/metrica-sdk-ios/blob/master/YandexMobileMetrica.podspec ). After integration, the code on the sqlite3_key function is simply not executed; however, there is no crash and no messages in the console.

YandexMobileMetrica also uses sqlite3 + SQLCipher and some kind of conflict apparently occurs, can it somehow be solved?

The test application code is simple:

var db: COpaquePointer = nil let documentsPath : AnyObject = NSSearchPathForDirectoriesInDomains(.DocumentDirectory,.UserDomainMask,true)[0] let path = documentsPath.stringByAppendingString("/data.db") if (sqlite3_open(path, &db) == SQLITE_OK) { print("open") let key = "secret" sqlite3_key(db, key, Int32(key.utf8.count)) if (sqlite3_exec(db, "SELECT count(*) FROM books;", nil, nil, nil) == SQLITE_OK) { print("ok") } else { print("no") } sqlite3_close(db); } 
  • one
    Do you have any access to the Appmetric database manager? If you unload / close it, can you open your base? - Valentine
  • Hey. The appmetric database is created during initialization. I didn't even initialize the library, the problem appears right after adding the dependency pod 'YandexMobileMetrica' and pod update - nullproduction

1 answer 1

Solved the problem with a crutch solution. I downloaded the podspec appliance file and removed the libraries 'sqlite3' from the property. Then he pointed to the local specification:

 pod 'YandexMobileMetrica', :podspec => 'YandexMobileMetrica.podspec' 

If someone prompts a less crutch solution, I will be grateful.

  • write them an issue on github - Max Mikheyenko
  • First I think that this is not their problem. secondly, I wrote an issue in the repository of appemetrics on other issues, answered half a year later, submitted later - nullproduction
  • Well then you can turn off sqlite from your project, since you still get it from YMM - Max Mikheyenko
  • it's not in my project ( rgho.st/7LQCDWZZG.view ). sqlite library sewn into SQLCipher - nullproduction
  • That's why this epl recommends not to do frameworks in frameworks - Max Mikheyenko