stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.59k stars 1.55k forks source link

Will not build on iOS 14 XCode 12 #1039

Closed austenstrine closed 2 years ago

austenstrine commented 3 years ago

I'm using Xcode 12.3, and affects devices on iOS 14+. Here is the version of SQLite.swift I am using in my podfile: pod 'SQLite.swift/SQLCipher', '~> 0.12.0'

This was working 3-4 months ago when I checked last. Now it gives me compiler errors:

SQLCipher/SQLCipher.framework/Headers/sqlite3.h:678:8: error: redefinition of 'sqlite3_file'
SQLCipher/SQLCipher.framework/Headers/sqlite3.h:777:8: error: redefinition of 'sqlite3_io_methods'
SQLCipher/SQLCipher.framework/Headers/sqlite3.h:1347:8: error: redefinition of 'sqlite3_vfs'
SQLCipher/SQLCipher.framework/Headers/sqlite3.h:1644:8: error: redefinition of 'sqlite3_mem_methods'
SQLCipher/SQLCipher.framework/Headers/sqlite3.h:6447:8: error: redefinition of 'sqlite3_module'
SQLCipher/SQLCipher.framework/Headers/sqlite3.h:6581:8: error: redefinition of 'sqlite3_index_info'
SQLCipher/SQLCipher.framework/Headers/sqlite3.h:6584:10: error: redefinition of 'sqlite3_index_constraint'
SQLCipher/SQLCipher.framework/Headers/sqlite3.h:6591:10: error: redefinition of 'sqlite3_index_orderby'
...and some 18 more of the same.

And it seems I'm not the only one to experience this issue: https://stackoverflow.com/questions/63971403/why-does-xcode12-give-me-sqlite-compiler-error

They have identified a workaround, but I would have to abandon the SQLCipher branch, which would be a very bad idea because of what I am using the package for.

Is there any chance we could get this to a point where it can compile without wonky workarounds?

Otherwise, I will be completely screwed for relying on this package when I built it into the app I'm maintaining in April of 2020. If you're going to abandon a package, say as much so that people don't build it into their projects, and so that people who have it in their projects already can start replacing it.

khsora34 commented 3 years ago

We did this for our project: https://stackoverflow.com/questions/64803179/how-do-i-avoid-build-errors-when-i-include-sqlcipher-pod-in-swift-project/65020426#65020426. You have to download the SQLite.swift library and used it locally, and adding SQLCipher as an external dependency.

ANGEL1YS commented 3 years ago

We did this for our project: https://stackoverflow.com/questions/64803179/how-do-i-avoid-build-errors-when-i-include-sqlcipher-pod-in-swift-project/65020426#65020426. You have to download the SQLite.swift library and used it locally, and adding SQLCipher as an external dependency.

still had same issue redefinition of bla bla bla, am i miss something ?

khsora34 commented 3 years ago

The answer in stack overflow worked for our project, dunno any further...

jiejueld commented 3 years ago

pod 'SQLCipher', '= 4.2.0' pod 'SQLite.swift/SQLCipher', '~> 0.12.2'

and change code in 'SQLiteObjc.h'

change line26: @import SQLite3; to @import SQLCipher;

this is work for me.

xcode 12.2 mac mini m1

nathanfallet commented 2 years ago

Should be fixed by #1051 and #1053