I am trying to compile a iOS application that uses SQlite in Xcode 4 (for Snow Leopard) and I am getting the following error -
error: /Apps/Cocktails/libsqlite3.dylib: No such file or directory
I copied the file libsqlite3.dylib into the Xcode project but the error won't go away. How do I resolve the error ?
EDIT - Here is the complete error log
CpResource libsqlite3.0.dylib /Users/ashishagarwal/Library/Developer/Xcode/DerivedData/Cocktails-gzqdmwrvzqciekgjzxnriugcxwwm/Build/Products/Debug-iphonesimulator/Cocktails.app/libsqlite3.0.dylib
cd /Apps/Cocktails
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Apps/Cocktails/libsqlite3.0.dylib /Users/ashishagarwal/Library/Developer/Xcode/DerivedData/Cocktails-gzqdmwrvzqciekgjzxnriugcxwwm/Build/Products/Debug-iphonesimulator/Cocktails.app
error: /Apps/Cocktails/libsqlite3.dylib: No such file or directory
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:
1:Open xcode on the computer where these files exists, add libsqlite3.0.dylib in your project from link binary with libraries.
2: Right click on the libsqlite3.0.dylib and show in finder.
3: Copy two files libsqlite3.0.dylib and libsqlite3.dylib and place on the same location on other computer where these files are missing.
Here you go, I had the same problem and solved in this way.
Related
I've read similar threads but wasn't able to find a solution to my issue.
When I start my project, I first saved it in a folder with blank space in its name (let name it "My Project")
Lets also simplify the path through my project as a simple folder : "My path" (yes, there was blank spaces in the hierarchy).
I used to have issues while building my project, especially with the Library search path in Build settings, regularly coming back with xcode updates or/and duplication of project for keeping a historical.
To solved that, I've replaced all the blank spaces with underscores. So now my project's folder name is "My_Project" and the path "My_path".
These changes have also been performed in the Build Settings of my project.
But today, I have an error I can't get rid of.
When I build my project, every file compile perfectly, but during the "copying" process, I get this kind of error.
/!\Copy AFNetworking ...in /Users/admin/Desktop/My_path/My Project/Product-name/Sub Folder
CpResource /Users/admin/Desktop/My_path/My\ Project/Product-name/Sub\ Folder/AFNetworking /Users/admin/Library/Developer/Xcode/DerivedData/Product-name-gkplyeugxcxhijajdvpxutaodxmz/Build/Products/Release-iphoneos/Product-name.app/AFNetworking
cd /Users/admin/Desktop/My_path/My_Project/Product-name
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /Users/admin/Desktop/My_path/My\ Project/Product-name/Sub\ Folder/AFNetworking /Users/admin/Library/Developer/Xcode/DerivedData/Product-name-gkplyeugxcxhijajdvpxutaodxmz/Build/Products/Release-iphoneos/Product-name.app
-------------------------------------
error: /Users/admin/Desktop/My_path/My Project/Product-name/Sub Folder/AFNetworking: No such file or directory
I don't find in my target's Build Settings any field where blank spaces haven't been replaced by underscores.
Any help appreciated.
(I'm using Xcode 7.2, OS X El Capitan 10.11.2)
I finally find somewhat by chance an answer to my problem.
I've opened the .xcodeproj file in finder, and then edit project.pbxproj.
In this file, I've founded a line :
84635D6F1C22F90100C55AB2 /* AFNetworking */ = {isa = PBXFileReference; lastKnownFileType = folder; name = AFNetworking; path = "/Users/admin/Desktop/My_path/My Project/Product-name/Sub Folder/AFNetworking"; sourceTree = "<absolute>"; };
And retyping it properly made the trick.
This medium post helped me: https://freakycoder.com/ios-notes-47-how-to-solve-xcode-no-such-file-or-directory-error-514106eaf287
Needed to remove the resource under Copy Bundle Resource during the Build Phase
I want to include a Messages_de.properties file in my Xcode project.
I my target's Build Phase I did:
![enter image description here][1]
When I try to build the project I get the following errors:
PBXCp /Users/mg/Documents/Grails/GGTS3.6.3-SR1-2/testproject-core/src/main/resources/testproject/core/i18n/Messages_de.properties /Users/mg/Library/Developer/Xcode/DerivedData/testproject-bkkczkzivpolszewxttakwlxnztk/Build/Products/Debug-iphoneos/testproject.app/testproject/core/i18n/Messages_de.properties
cd /Users/mg/Documents/Grails/GGTS3.6.3-SR1-2/testproject
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/mg/Documents/Grails/GGTS3.6.3-SR1-2/testproject-core/src/main/resources/testproject/core/i18n/Messages_de.properties /Users/mg/Library/Developer/Xcode/DerivedData/testproject-bkkczkzivpolszewxttakwlxnztk/Build/Products/Debug-iphoneos/testproject.app/testproject/core/i18n
error: couldn't create directory /Users/mg/Library/Developer/Xcode/DerivedData/testproject-bkkczkzivpolszewxttakwlxnztk/Build/Products/Debug-iphoneos/testproject.app/testproject/core/i18n: Not a directoryerror: open /Users/mg/Library/Developer/Xcode/DerivedData/testproject-bkkczkzivpolszewxttakwlxnztk/Build/Products/Debug-iphoneos/testproject.app/testproject/core/i18n/Messages_de.properties: Not a directory
(null): error: couldn't create directory /Users/mg/Library/Developer/Xcode/DerivedData/testproject-bkkczkzivpolszewxttakwlxnztk/Build/Products/Debug-iphoneos/testproject.app/testproject/core/i18n: Not a directory
(null): error: open /Users/mg/Library/Developer/Xcode/DerivedData/testproject-bkkczkzivpolszewxttakwlxnztk/Build/Products/Debug-iphoneos/testproject.app/testproject/core/i18n/Messages_de.properties: Not a directory
What causes these errors and how do I fix them?
You are trying to include a directory instead of a file.
Verify into your code, you probably are using directory manager to manage a file.
Recently I am doing some AllJoyn development on iOS and OS X. When I run xcodebuild for alljoyn_darwin.xcodeproj using command line as below:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project alljoyn_darwin.xcodeproj -scheme alljoyn_core_ios -sdk iphoneos -configuration Debug PLATFORM_NAME=iphoneos
I got an error like this:
export variant=normal
/opt/local/bin/scons -u OS=darwin CPU=arm BR=on BINDINGS=cpp SERVICES= WS=off VARIANT=Debug --
scons: *** No SConstruct file found.
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.4/SCons/Script/Main.py", line 920, in _main
Command /opt/local/bin/scons failed with exit code 2
** BUILD FAILED **
The following build commands failed:
ExternalBuildToolExecution alljoyn_core_ios
(1 failure)
I really have no idea why I got this, I followed all the instruction in the official site--Build From Source and I am sure I set the correct OPENSSL_ROOT path. I installed scons using Macport and it was installed correctly. I tried double-click the alljoyn_darwin.xcodeproj from finder but I got the same error.
scons: *** No SConstruct file found.
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.4/SCons/Script/Main.py", line 920, in _main
Command /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/scons-2.3.4 failed with exit code 2
So I am stuck here. But the thing is I can successfully run AllChatz sample in sdk_14.12 for iOS in iphonesimulator for iPhone6. openssl version is 1.0.2 and I tried build both for alljoyn sdks 14.06 and 14.12. same error happened. I don't know if this is related. Anyone can help here? Many thanks.
The problem is that scons cant find the root-level SConstruct script, which probably doesnt help much as you can see that in the error :)
When you use the "-u", that tells scons to look up the directory structure for the root-level SConstruct script.
SCons must be executed from within the project directory structure. Look for the root-level SConstruct, and make sure you're executing scons from within the project directory structure.
I'm trying to build quantlib for xcode 4.6.
The project of concern is this one: https://github.com/philipbarnes/quantlib-on-iOS
This quantlib project relies on this boost project: https://gitorious.org/boostoniphone/boostoniphone
My problem is I cannot get this boost to build, but I can get another version to build on github also by Pete.
One of the steps in building quantlib for iOS asks to set the boost dir. I tried to adjust this to no avail.
This means I have a dir 'boostoniphone-huuskpes-boostoniphone' - which does not build and was said to be the version to use with the quantlib on iPhone project,
and the dir 'boostoniphone-master' which did build - it has a different build structure with folders and maybe setting the $BOOSTDIR variable in the quantlib project isn't so simple.
These outputs from the console have been shorted for more comfortable reading
My gitorious boost output says:
3 warnings generated.
darwin.archive bin.v2/libs/thread/build/darwin-6.1~iphonesim/release/architecture-x86/link- static/macosx-version-iphonesim-6.0/target-os-iphone/threading-multi/libboost_thread.a
common.copy stage/lib/libboost_thread.a
...updated 120 targets...
=================================================================
Done
Splitting all existing fat binaries...
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: can't open input file: /Users/colman/Downloads/boostoniphone-huuskpes- boostoniphone_/src/boost_1_51_0/bin.v2/libs/thread/build/darwin-4.2.1~iphone/release/architecture- arm/link-static/macosx-version-iphone-6.0/target-os-iphone/threading-multi/libboost_thread.a (No such file or directory)
...
and continues with problem repeated , then this error is next
...
ar: obj/*.o: No such file or directory
...armv7s
ar: obj/*.o: No such file or directory
...i386
ar: obj/*.o: No such file or directory
liboficate: thread
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: can't open input file: /Users/colman/Downloads/boostoniphone-huuskpes- boostoniphone_/src/boost_1_51_0/bin.v2/libs/thread/build/darwin-4.2.1~iphone/release/architecture-arm/link-static/macosx-version-iphone-6.0/target-os-iphone/threading-multi/libboost_thread.a (No such file or directory)
as the other boost project works for me it, I try to link it into the buildql.sh script as a boost ref, but I get:
checking for arm-apple-darwin10-gcc... /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple- darwin10-llvm-gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Users/colman/Downloads/boostoniphone-huuskpes-boostoniphone_/QuantLib-1.2.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
and
/Applications/Xcode.app/Contents//Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: can't open input file: /Users/colman/Downloads/boostoniphone-huuskpes-boostoniphone_/QuantLib-1.2.1/prefix/armv7/lib/libQuantLib.a (No such file or directory)
A pointer to how to make frameworks may also be a solution? But I think getting the quantlib for iOS project to work is the real solution.
Coming back to the BOOST variable, in the buildql.sh file, changes such as the following have been made:
#: ${BOOST_HOME:=$HOME/workspace/huuskpes-boostoniphone}
: ${BOOST_HOME:=$HOME/workspace/boostoniphone-master/}
: ${BOOST_SRC:=$BOOST_HOME/src/boost_1_51_0}
The following were also altered to attempt to fit the 'boostoniphone-master'
: ${SRCDIR:=`pwd`/src}
: ${BUILDDIR:=`pwd`/build}
: ${PREFIXDIR:=`pwd`/prefix}
: ${FRAMEWORKDIR:=`pwd`/framework}
Thanks for any hints, potential solutions.
Changes to the buildql.sh script look like this:
: ${BOOST_HOME:=/Volumes/Untitled\ 1/workspace/boostoniphone-master/iphone-build/stage/lib}
: ${BOOST_SRC_HOME:=/Volumes/Untitled\ 1/workspace/boostoniphone-master/boostoniphone-master}
: ${BOOST_SRC:=$BOOST_SRC_HOME/src/boost_1_51_0/boost}
...
: ${SRCDIR:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/src}
: ${BUILDDIR:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/build}
: ${PREFIXDIR:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/prefix}
: ${PREFIXDIR_2:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/prefix}
: ${FRAMEWORKDIR:=/Volumes/Untitled\ 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a}
Build command runs with a new error:
./buildql.sh -with-boost-include=/opt/local/include/ --with-boost-lib=/Volumes/Untitled 1/workspace/boostoniphone-master/iphone-build/stage --prefix=/opt/local/
Current output looks like this:
libtool: link: (cd .libs/libExperimental.lax/libAmortizingBonds.a && ar x "/Volumes/Untitled 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/ql/experimental/amortizingbonds/.libs/libAmortizingBonds.a")
../../libtool: line 1096: cd: .libs/libExperimental.lax/libAmortizingBonds.a: No such file or directory
make[3]: *** [libExperimental.la] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
=================================================================
Done
rm: /Volumes/Untitled: Resource busy
=================================================================
Framework: Setting up directories...
=================================================================
Framework: Creating symlinks...
ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Versions/Current: No such file or directory
ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Headers: No such file or directory
ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Resources: No such file or directory
ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Documentation: No such file or directory
ln: 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/ql: No such file or directory
=================================================================
Framework: Lipoing library into /Volumes/Untitled 1/workspace/quantlib-on-iOS-master/./ql/.libs/libQuantLib.a/ql.framework/Versions/A/ql
/Applications/Xcode.app/Contents//Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: can't open input file: $ /Applications/Xcode.app/Contents//Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo -create -arch armv7 /Volumes/Untitled 1/workspace/quantlib-on-iOS- master/QuantLib-1.2.1/1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/ql/.libs/libQuantLib.a -arch armv7s /Volumes/Untitled 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/ql/.libs/libQuantLib.a -arch i386 /Volumes/Untitled 1/workspace/quantlib-on-iOS-master/QuantLib-1.2.1/1/workspace/quantlib-on-iOS-master/ QuantLib-1.2.1/ql/.libs/libQuantLib.a -o /Volumes/Untitled (No such file or directory)
Aborted: Lipo failed
Rather than go into all the script details the following is the solution:
Set the paths carefully, that means, try not to have spaces or have data on external drive (although you can)
Set the parameters for the ARM chip, simulator and the iOS version installed very very carefully!
All in all that should be the most of it.
Part of my build process is to create a tar file of an input directory, located at src/bundle/bundle. In src/bundle/SConscript:
Import('*')
bundleDir = Dir("bundle")
jsontar = Command("bundle.tar", bundleDir,
"/home/dbender/bin/mkvgconf $SOURCE $TARGET")
in my SConstruct:
SConscript(Split('src/bundle/SConscript'),
exports='bin_env lib_env', build_dir='tmp/bundle')
When attempting to build:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/home/dbender/bin/mkvgconf tmp/bundle/bundle tmp/bundle/bundle.tar
Input directory tmp/bundle/bundle not found!
scons: *** [tmp/bundle/bundle.tar] Error 1
scons: building terminated because of errors.
Clearly scons is not copying the src/bundle/bundle to tmp/bundle/bundle, but I am stumped as to why.
Footnotes:
Using absolute pathname for mkvgconf is bad practice but just intermediate until I have this problem solved.
SCons doesn't know anything about the contents of your input src/bundle/bundle - only the program mkvgconf knows what it does with that directory.
One solution is to add an explicit dependency in the SConscript:
import os
Depends('bundle.tar', Glob(str(bundleDir) + os.path.sep + '*'))
That also means that when you update the contents of the bundle directory, the mkvgconf script will be rerun.
PS. you might want to change the build_dir argument name to variant_dir, as the former is deprecated in favor of the latter in recent SCons releases.