Sqlite.swift: Could not build Objective-C module?

Created on 28 Apr 2015  路  17Comments  路  Source: stephencelis/SQLite.swift

Hi, I am having an issue with SQLite. Ever since I have updated my version of XCode to version 6.3, I have been getting an issue saying that it cannot find the module SQLite3 when I try to import it into my files using import SQLite. As a result, I resorted to deleting the entire SQLite folder from my project and re-adding it to my project. However, now I am getting issues saying Header '/usr/include/sqlite3.h' not found and Could not build Objective-C module 'sqlite3. It was all working for me previous to this but now I have no idea and every time i re-add the folder to my project, I get this error or an error saying Coudl not build Objective-C module SQLite. Any help would be appreciated. Thanks!

bug

Most helpful comment

"import Foundation" fixed it for me

All 17 comments

Hm, that might be related to this commit: https://github.com/stephencelis/SQLite.swift/commit/2bf90d49cc982589b6d7ed9585f3f8f41ccf3263

Can you try checking out the commit just prior and see if that solves your problem? https://github.com/stephencelis/SQLite.swift/commit/213920b2f65d7ae92bb2c93cfa02a2e6e19f8ee9

(Here's a download link if you're not using git: https://github.com/stephencelis/SQLite.swift/archive/213920b2f65d7ae92bb2c93cfa02a2e6e19f8ee9.zip)

Ah that seems to work better but now I am getting an error saying Cannot load underlying module for 'XCTest'. Any ideas on how to fix this?

Reverted that commit, so master should hopefully work fine now.

It looks like a module map's path is absolute, not relative to the current SDK root, so if you don't have the command line tools installed you couldn't build SQLite.swift.


@schan93 As far as Cannot load underlying module for 'XCTest' goes, it means you're somehow linking against the test target. Please re-read the installation instructions and avoid any cases of SQLite Tests, etc.

"import Foundation" fixed it for me

this bug has been fixed right? I'm getting the "Could not build Objective-C module 'SQLite' "

I'm getting this as well, along with "Header 'SQLite-Swift.h' not found."

@clehew how do you integrate SQLite.swift into your project?

@jberkel CocoaPods. XCode 8.2, Cocoapods v1.1.1, pod 'SQLite.swift', '~> 0.11.1'

@clehew and Xcode installed in /Applications/Xcode.app?

@jberkel actually, I just realized that it's in a different location... I'll move it

@jberkel I moved it, still didn't work, then I uninstalled/reinstalled, still not working, same error

@clehew. hmm, weird. can you check if a minimal project via pod try SQLite.swift compiles ok?

@clehew Hi, I've had the same issue today(Xcode 8.2, pod 'SQLite.swift', '~> 0.11.1' ).
it's been fixed with moving Xcode to /Applications/Xcode.app and running this line in terminal:
sudo xcode-select --switch /Applications/Xcode.app

@ehsan-black thanks for the hint, will add it to the instructions

@jberkel Sorry for the slow response, I have been away on vacation, but I'm still fighting this strange error. I know now that is probably not Sqlite.swift. I have managed to see the error change to SnapKit-swift.h on a few occasions and I was able to create a bare bones project that built fine. this is the set of errors I'm getting if you have any ideas.

I'm at a loss at this point, I've event updated to the latest cocoapods beta because some people claimed that helped for another library.

screen shot 2017-01-02 at 5 16 46 pm

@clehew I have no idea, but looks like a bigger config problem in your project. To troubleshoot I'd simplify the project (remove files which cause an error) until the project builds successfully.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zackdh9 picture zackdh9  路  5Comments

RockyQu picture RockyQu  路  6Comments

lucascorrea picture lucascorrea  路  5Comments

Tchoupinax picture Tchoupinax  路  8Comments

arnoldschmid picture arnoldschmid  路  4Comments