I have no problem running the code but how can I remove all the warnings ? I am afraid that App Store will reject my app. Please refer to my image
Hi @andrewlim7
For the gethostuuid() warning – that is deliberate, please see this post for additional information: Warnings for sqlcipher XCode 9 gethostuuid() is disabled
There are definitely some other integer conversion warnings within sqlite3 itself, that can be safely ignored (for the time being anyway).
Could you post the warning details from your build log, and let us know if there are any specific warnings that you have a question about?
If the warnings are from upstream sqlite3 and they bother you, you should either be able to silence them with a -w
compiler flag or compile SQLCipher once and link against the .a
Cheers,
Micah
Hi @mmoore,
How about the warnings for semantic issue ? Btw, I’m new to ios. I don’t know where to get the build log but I google for it and the files are in derived data, however I don’t know which file it is.
May I know how can I silent them? I do not know what is the link against the .a and what is -w compiler flag.
Sincerely,
Andrew
How about the warnings for semantic issue ? Btw, I’m new to ios. I don’t know where to get the build log but I google for it and the files are in derived data, however I don’t know which file it is.
After building your project, you can retrieve the build log be opening the Navigator (the left pane of Xcode), selecting the “Show Report Navigation” tab, selecting the build you just performed, filter on “All Issues” (what we’re interested in here) at the top, then click the save button to save the output to a file (or hold down on the option key and click the save button to copy it to the clipboard).
May I know how can I silent them? I do not know what is the link against the .a and what is -w compiler flag.
There are further instructions for linking against the .a here:
Within Build Phases → Compile Sources there’s a spot for compiler flags. You can pass in a -w
flag to silence all warnings when compiling that specific file.
This is what I got when I tried to -w in compiler sources for the sqlite3.c. Btw, I am using sqlcipher through cocoa pod so yeah I don’t have the sqlcipher in the TARGETS.
Those errors don’t appear to be related to SQLCipher at all. It seems like an error in your SearchVC.swift class when referencing VGSegment You may want to try looking at their repo and ensure that you’re following the integration instructions and/or reach out to them.
Cheers,
Micah
I am so sorry, I uploaded a wrong image, please refer back to the post with updated image.
Cheers,
Andrew
Those warnings suggest that the target, SQLCipher
(the errors above are for the framework target, yeah?), does not have sqlite3.h
in its search paths for headers. That file declares the symbols in sqlite3.c
that Xcode is determining are implicitly declared.
If you switch to the project navigator view in Xcode (keyboard shortcut ⌘ 1), is there a sqlite3.h
file present? There is a search field you can use to check quickly. If not, you’ll want to select File > “Add Files to [target name]…” From there navigate to and select the sqlite3.h
file generated with your libsqlcipher.a
. There will be an Options button on that add dialog, select it and make sure no targets are set (as this is a header file, not a source file, we don’t want to add it to your targets Compile Sources, which is what that checkbox does).
Alternatively, or if that doesn’t work, have a look at the Header Search Paths setting under the Build Settings for your target and make sure that the path to your SQLCipher build’s sqlite3.h
is listed there.
Finally, take a look at our guidance for Xcode 9, which deals with this and similar problems.
I just retried using the SQLCipher cocoa pod and was able to integrate it fine.
A couple of suggestions:
- When using
pod install
make sure thexcodeproj
isn’t already associated with anxcworkspace
- After
pod install
it should generate anxcworkspace
in the same directory as thexcodeproj
. Make sure that this is what you’re opening in Xcode (as opposed to thexcodeproj
)
If neither of those suggestions are helpful, I would recommend trying to create a simple project that uses the SQLCipher pod and ensure that is working before you expand upon it from there. Here are some basic instructions on how to do that:
- Within Xcode create a new project.
- Open terminal and cd into the project directory (where the
xcodeproj
) is located. - Pod Initialize →
pod init
- Edit the Podfile →
open -a Xcode Podfile
- Add the SQLCipher Pod dependency → Add this line:
pod 'SQLCipher'
right under the comment:# Pods for <Project Name>
- Quit Xcode.
- In terminal, still in the same project directory, run:
pod install
this should produce a<Project Name>.xcworspace
after it outputs “Pod installation Complete!” - Open that
<Project Name>.xcworkspace
in Xcode and write some basic test code to ensure that SQLCipher is properly integrated – there’s some sample integration code at the bottom the this iOS/OSX tutorial (make sure to#import "sqlite3.h"
)
Let me know if this helps. Thanks!
Cheers,
Micah