Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible duplication of sqlite3 library causes multiple error #220

Open
doganaltinbas opened this issue Aug 26, 2024 · 4 comments
Open

Possible duplication of sqlite3 library causes multiple error #220

doganaltinbas opened this issue Aug 26, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@doganaltinbas
Copy link

doganaltinbas commented Aug 26, 2024

I have project that sqlite3 pod already installed to manipulate data stored in app.
After I installed Amplitude via SPM I got following errors when I run the project. I got Could not build Objective-C module 'SQLite3' for many files and many redefinition method errors like following:

sqlite3pod/src/sqlite3.h:654:8 Redefinition of 'sqlite3_file'
sqlite3pod/src/sqlite3.h:752:8 Redefinition of 'sqlite3_io_methods'
sqlite3pod/src/sqlite3.h:1234:8 Redefinition of 'sqlite3_vfs'

Would that be related if Amplitude also utilizes the sqlite? Any ideas on how to fix it?

Environment

  • SDK Version: v1.9.0
  • Xcode Version: 15.4.0
  • iOS Version: 17.5
@doganaltinbas doganaltinbas added the bug Something isn't working label Aug 26, 2024
@crleona
Copy link
Collaborator

crleona commented Aug 27, 2024

Hi @doganaltinbas we do link to the system Sqlite3 distribution to be able to import files from our legacy SDK. Is there a reason you are importing sqlite via a pod vs just using the system distribution?

@doganaltinbas
Copy link
Author

doganaltinbas commented Aug 28, 2024

The legacy code I'm working with uses SQLite pod to cache bulk data for offline mode. I resolved the issue by converting the wrapper I wrote for Amplitude into Objective-C. However, I'm still unsure why the Amplitude wrapper causes errors when used with Swift.

@crleona
Copy link
Collaborator

crleona commented Aug 29, 2024

@doganaltinbas ObjC is generally a bit less strict with linking issues. The core issue is that we link with the system sqlite3 distribution, and you are linking to an external one, and there's no namespacing with C APIs. Generally using the system library is encouraged as it leads to smaller app sizes and launch times. You may need the pod if you need a specific SQLite3 version or using non-standard compilation options, but these tend to be extremely uncommon cases. Do you have a specific use case as to why you can't use the system SQLite distribution?

@doganaltinbas
Copy link
Author

@crleona We've used it to save custom objects and implement custom flags that the standard Apple SQLite3 library doesn't support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants