libsqlite3.dylib framework accidenlty deleted from xcode - ios

libsqlite3.dylib is accidently deleted from my Xcode . It is shown as red in "Link Binary with Libraries" (Build Phases) . Not in Trash too . Do I need to install xcode again ?

While the above answers do tell you how to go about adding the library to Xcode, what happens if you cannot find the library? I noticed this issue, and then did a search in Spotlight for libsqlite3, which did not locate any files. While it is kind of crude, you can jump to a Terminal session to locate files throughout your file system. Spotlight does not index everywhere on your drives, and my suspicion is that it does not include the locations where this file lives. At a terminal prompt, type:
find / -name libsqlite3.dylib -print
This is a UNIX command that will locate the file, starting at the root, and printing out the results it finds. You can press CTRL-C to cancel the search at any time. I actually found it within the Xcode bundle; in this case I am running Xcode 7 Beta, so it was found in:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
For convenience, I copied the file from this folder to a Resources folder under Documents, where I keep libraries and other files for easy reference in my projects.
Please note, if you are developing in Swift, then you need to edit your Bridging-Header.h file, and add the line:
#imports <sqlite3.h>
If you don't have the Bridging Header, you can add it to your project, follow the steps:
Create a new file, Bridging-Header.h in your project.
Add the line above.
Go to your Project Build Settings (click on the Project,
click on Build Settings tab).
Locate "Swift Compiler - Code
Generation", "Objective-C Bridging Header" setting, and add the name
of the file above "Bridging-Header.h"

It looks your library is missing libsqlite3.dylib and libsqlite3.0.dylib, so copy these files from any other computer and place these files in your computer.
Procedure:
Open xcode on the computer where these files exists, add libsqlite3.0.dylib in your project from link binary with libraries.
Right click on the libsqlite3.0.dylib and show in finder.
Copy two files libsqlite3.0.dylib and libsqlite3.dylib and place on the same location on other computer where these files are missing.
original post:
XCode 4 - libsqlite3.dylib: No such file or directory

Related

Xcode cant find file in explore while file exits in finder

New to this Xcode sh*t(sorry for that, but really pissed off by Xcode)
The thing is I could find there should be a specific file by grep or finder, but in the Xcode project, the file does not exist here:
Here is the result with grep in the project folder
And here is the project hierarchy in Xcode.
They are mismatch!
Can't apple just make this Xcode sh*t right? How could I find this file in Xcode's folder? Thanks
Check if that file exist into Copy Bundle Resources.
Click "Your project name" from Xcode left sidebar then select your main target and go to Build phases tab and inside that go to Copy Bundle Resources and check whether that file exists or not.

Xcode 7: Linker warning for -F/<path> but no settings in app.xcodeproj/project.pbxproj match <path>

I converted a Swift 1.x project for iOS to Swift 2.x using Xcode 7 beta 3. It compiles and runs but I have a linker warning persisting. I've done a search through the project.pbxprox for the offending path, and have looked in the "build settings" in Xcode but no sign of the offending path (not even in the Library Search Path or the Framework Search Path). I did, however, find that the xcuser state file contains the substring.
The warning: 'ld: warning: directory not found for option "-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks\"'
The searches:
[foo#bar baz{Swift2}]$ grep -r Baz.xcodeproj/ iPhoneOS9.0
grep: iPhoneOS9.0: No such file or directory
[foo#bar baz{Swift2}]$ grep -r 'Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks' Baz.xcodeproj/
Binary file Baz.xcodeproj//project.xcworkspace/xcuserdata/bar.xcuserdatad/UserInterfaceState.xcuserstate matches
[foo#bar baz{Swift2}]$
As usual, I've done a "clean" on both the project as well as the simulators (watch, iPhone).
I've examined the directory path and see that indeed there is no such path; the path components exist up to the 'iPhoneOS9.0.sdk' component. That is, this path exists: '/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk' but there is no 'Developer' subdirectory at that location. There is, however, a framework directory underneath, but it's at 'iPhoneOS9.0.sdk/System/Library/Frameworks/' instead of 'iPhoneOS9.0.sdk/Developer/Library/Frameworks'.
I've seen this same issue. I believe that it happens because of some path incorrectly hard-coded into the test target's build settings. I don't know what path it is; my response is to delete the test target, and then the error goes away.
You can always make a new test target, and you don't have to delete the test files, so it's no great loss.
If you get this issue after upgrading Xcode, then just in Xcode click;
File -> Open Recent -> Clear Menu.
Xcode -> Quite Xcode
Go to your project directory and open your project normally.
click cmd + alt + shift + K, this will clean your project
clcik cmd + B
Then you should be fine.
Change framework search path to $(PROJECT_DIR)/* for your test target

iOS Programming, Xcode 6.1.1. Error: Data file 'library.a-x86_64.fin' does not exist. Finalizing - Failed

I am using third party library files which contains .h, static library (.a), .fin, .key files. The readme says:
1) .fin, .key & .a files should be present on same location.
2) Add flags "-finalize -prefinalized-library library_name.a" in "Other Linker Flags" option.
3) Click Yes on "Write Link Map File" option.
I have created a new group/folder in the project from the "Xcode's Project Navigator" window & placed .a, .key, .fin files & followed the same steps as mentioned & when I was trying to compile the application, .fin files were not found during linking.
When I removed the "Other Linker Flags option" the application was getting compiled. But the readme says "Other Linker Flags option" is mandatory for using the library.
Apart from this. When I copied .a, .key, .fin files without creating any folder then the application compiles successfully. But if these files are placed inside a folder in the application then application fails to compile.
Can anyone please help me on this. How & where to provide the path to .key, .fin files so that the application gets compiled using the finalizer.
Xcode 6.1.1
iOS SDK version 8.1
OS X - Yosemite 10.10.2
I had the same issue. I resolved by adding the flag -Wfin-data-files {PATH}. The path is where Xcode can find the .fin files

iOS project won't compile because it can't find pch file as I had to rename folders

I'm new to iOS development, and I was using this guy's oauth implementation:
https://github.com/Christian-Hansen/simple-oauth1,
so I built a project based on his project file for simplicity's sake.
After a while I realised that I didn't like the folder structure, so I changed it by renaming some folders. I had to replace a bunch of files that came up red. Now I get these errors when I try to compile:
- Check dependencies:
Warning: The Copy Bundle Resources build phase contains this target's info.plist file '/Users/Manuel/Desktop/MyApp/MyApp/MyApp-info.plist'
- Precompile MyApp-Prefix.pch ...in /Users/Manuel/Desktop/MyApp/Simple-OAuth1
... a bunch of ProcessPCH stuff here that I can't decipher
clang: error: no such file or directory: '/Users/Manuel/Desktop/MyApp/Simple-OAuth1/MyApp-Prefix.pch
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
I have changed the folder name from Simple-OAuth1 to MyApp. I replaced the prefix file so it's not red anymore. Is there some setting somewhere that I need to change to get it to work? I also tried cleaning the project.
go to 'Build Phases' in your Target and remove the .plist file from 'Copy Bundle Resources'
go to 'BuildSettings' in your Target and search for 'Prefix Header' there you should check if the path is the same as your new/current .pch file
When you rename folders in your project sometimes you have to update the Build Settings in your project, especially when you rename the folders for things like *-info.plist and your *-prefix.pch files. But luckily this is simple to do following the below steps:
Updating *-prefix.pch location
Open your project up in xcode
Navigate to Build Settings for the Target you need to update.
In the Build Settings search bar type in "Prefix Header" or just "pch".
Double click the value field for Prefix Header and enter the new location for your *-prefix.pch file.
Save.
Updating *-info.plist location
Open your project up in xcode.
Navigate to Build Settings for the Target you need to update.
In the Build Settings search bar type in "Info.plist File" or "plist".
Double click the value field for Info.plist file and enter the new location of your *-info.plist file.
Save.

Validation Error: The bundle contains disallowed file 'Frameworks'

I'm having the same issue as this guy, this guy, and this guy (nota bene, I'm actually not sure if they're all guys, per se).
They all ended up finding their own solutions, but none of them apply to my issue. I'm using Xcode 6.1 in my iOS 8 app with an included extension. The app and the extension both rely on an included framework. When I try to submit the app to the Store, the validation warning I get is "ERROR ITMS-9000: Invalid bundle. The bundle at 'xxxxx.appex' contains disallowed file 'Frameworks'".
I can't even find a file called Frameworks. The shared framework is supposed to be saved at /Library/Frameworks, which is Apple's recommended save location. The project also uses Cocoapods, which strikes me as the only other possible culprit, since it has references in its configuration files to $FRAMEWORK_PATH (though the build folder doesn't include a file or folder with that name).
OK for future viewers here's the fix:
When you create your own iOS framework (I'm using Xcode 6.1) when you build it the final product contains a 'Frameworks' folder in the framework bundle itself. i.e. MyFramework.framework/Frameworks. This happens even if you don't specify a copy files/embed frameworks build phase.
What you have to do is to go into you framework bundle, find the empty frameworks folder and delete it. This should not affect your app's functionality in any way. Then build your app and check that the embedded framework doesn't have a Frameworks folder as planned.
Your archive should now not contain the offending folder and the error should be gone!
I changed build settings > Packaging > Define modules set to YES in my extension and watch app target. Works fine for me.
In my case the solution was the following :
Try to create the script there 'problematic target' -> Build Phases' then click on + and select New Run Script Phase, the run script should go after all others. Insert there :
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then
rm -fr Frameworks
fi
Then clean the project and try to create an archive once again. These answer was provided in the following issue :
https://github.com/CocoaPods/CocoaPods/issues/4203
I hope this help you.
Continuing to work with this, I noted that my Share Extension had an "Embed Frameworks" Build Phase, with the Destination set to the "Frameworks" directory. I changed it to "Shared Frameworks" and the error has gone away.
However, another error remains: "... contains disallowed nested bundles". I thought this was a sort of umbrella error warning as a result of the original. I'll open another question for that one.

Resources