Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS cocoapods - how to add libsqlite3.dylib

I'd like to include the iOS framework for libsqlite3.dylib as a framework within a cocoapod. In my .podspec file I have a line like this:

 spec.framework    = 'libsqlite3.dylib'

When I run the pod install, it installs okay, but there is an error during build.

 framework not found libsqlite3.dylib

I can manually add the library by searching for it within the Build Phases > Link Binary with Libraries > + menu. However, then I'd have to comment out my podspec line for the framework to get the errors to go away. I'd really like to get this working using cocoapods without the manual step.

...so I'm assuming that I'm doing something wrong with how I set the framework within the podspec file.

like image 553
ldeluca Avatar asked Mar 26 '15 17:03

ldeluca


1 Answers

"libsqlite3.dylib" is a dynamic library and not a framework. For including libraries in your Podspec you should just use:

spec.library = 'sqlite3'
like image 169
gagarwal Avatar answered Oct 08 '22 18:10

gagarwal