Error: in auto-import: failed to get module 'project name' from AST context:


#1

Bridging-Header-Path:21:9: note: in file included from -Bridging-Header-Path :21:
#import sqlite3.h

Hi,
I integrated sqlcipher into my project and It is working good. But Xcode Debug stopped working and I am getting this error as follows

error: in auto-import: failed to get module ‘project name’ from AST context:

Bridging-Header-Path:21:9: note: in file included from -Bridging-Header-Path :21:
#import sqlite3.h

warning: ‘SQLITE_SOURCE_ID’ macro redefined
#define SQLITE_SOURCE_ID “2017-08-24 16:21:36 8d3a7ea6c5690d6b7c3767558f4f01b511c55463e3f9e64506801fe9b74dce34”

I think sqlite3.h is duplicated can you please help me solve this so that I can debug and can po(print out ) in debug console

thanks,
Subbu


#2

@Subbu

Thank you for your interest in SQLCipher and for posting to the discussion forum.

It looks like your #import sqlite3.h statement in the bridging header doesn’t have brackets around it – i.e #import <sqlite3.h>

If that doesn’t resolve the issue, how are you integrating SQLCipher? via cocoa pods?

Cheers,
Micah


#3

Hi,

I did keep brackets in birding header file. the exact statement is #import <sqlite3.h>.

Thanks,
Subbu


#4

@Subbu,

Thanks for clarifying that.

Could you please let me know the answers to the question in my previous response:

If that doesn’t resolve the issue, how are you integrating SQLCipher? via cocoa pods?

If you have a sample project that can easily reproduce the issue you’re facing that would also be helpful.

Cheers,
Micah


#5

Hi,
I integrated free version of SQLCipher manually(not from cocoa pods).
Can you provide me the link for how to install through cocoa pods as I couldn’t find it.
It is working fine in sample project but not in the main project.
thanks
Subbu


#6

@Subbu

Because the sample project works fine for you, my best guess is that you have something duplicated in your main project. This StackOverflow post sounds like it’s identical to your error. So I would recommend going through your project and making sure you aren’t duplicating imports of something that was already imported via one of the dependencies you use. Sometimes it can be useful to create a new project and add dependencies one by one to figure out at what point the issue occurs (starting with SQLCipher first).

Can you provide me the link for how to install through cocoa pods as I couldn’t find it.

While we don’t provide instructions on how to integrate SQLCipher via cocoa pods, it’s relatively straight forward if you know how to use cocoa pods:

After you initialize a Podfile (using pod init), just place pod 'SQLCipher' within it, then pod install.

Then if you’re using swift you’ll also need to add $(PODS_ROOT)/SQLCipher to the Header Search Paths of your project (we’re planning on adjusting that in the podspec in the next release of SQLCipher), and add the Bridging Header (similar to the standard SQLCipher integration instructions).

Let me know if you’re able to locate the duplicate issue in your main project.

Cheers,
Micah