ios - "libtool failed with exit code 1" after a clean - ios

I was working on a project and all were going well until I decide to clean my project.
The following errors appears only when I run my app on simulator (working fine on a real device) :
Libtool /Users/Yaman/Library/Developer/Xcode/DerivedData/Homeless-gujyzhsiwenufvedlinbbtrizcpd/Build/Products/Debug-iphonesimulator/libShareKit.a normal i386
cd "/Users/Yaman/Documents/iOS - App à vendre/Homeless/Submodules/ShareKit"
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only i386 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/Yaman/Library/Developer/Xcode/DerivedData/Homeless-gujyzhsiwenufvedlinbbtrizcpd/Build/Products/Debug-iphonesimulator -filelist "/Users/Yaman/Library/Developer/Xcode/DerivedData/Homeless-gujyzhsiwenufvedlinbbtrizcpd/Build/Intermediates/ShareKit.build/Debug-iphonesimulator/Static Library.build/Objects-normal/i386/ShareKit.LinkFileList" -ObjC -all_load -lCopy -lDelicious -lDiigo -lEmail "-lEvernote SDK" -lEvernote -lFacebook "-lFlickr SDK" -lFlickr -lFoursquareV2 "-lGoogle Reader" -lInstagram -lInstapaper -lJSONKit -lKippt -lLinkedIn -lLogout -lOAuth "-lOpen in Safari" -lPinboard -lPrint -lReachability "-lRead It Later" "-lSave to Album" -lShareKitCore "-lSina Weibo" -lSSKeyChain "-lText Message" -lTumblr -lTwitter -lVKontakte -o /Users/Yaman/Library/Developer/Xcode/DerivedData/Homeless-gujyzhsiwenufvedlinbbtrizcpd/Build/Products/Debug-iphonesimulator/libShareKit.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified, -all_load invalid
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lReachability
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lReachability is not an object file (not allowed in a library)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1
I got these errors when running command xcodebuild directly from a terminal :
** BUILD FAILED **
The following build commands failed:
Libtool "build/ShareKit.build/Release-iphoneos/Static Library.build/Objects-normal/armv7/libShareKit.a" normal armv7
Libtool "build/ShareKit.build/Release-iphoneos/Static Library.build/Objects-normal/armv7s/libShareKit.a" normal armv7s
(2 failures)
Someone can figure out what's happened here ?

I just got this error. The project works very well, you add a new lib and BAM, build failed.
I my case, Xcode5 had added some special \" around my header search paths values.
Like that :
\"$(SRCROOT)/myproject/Libraries/lib\"
Quite impossible to find out, but when spending hours to find where is the problem, I finally tried to change to
$(SRCROOT)/myproject/Libraries/lib
And the build success came back... thanks Xcode!

The first error note says that compiling ShareKit failed, because Reachability is missing. I'd propose that you check your compiling environment has latest (or compatible) version of the library.
That's why libShareKit.a mentioned in last error note is missing and compiling your app failed. Try to compiling ShareKit alone and when it's done, try again the whole app.

Related

React-native: iOS wont install - libtool error

I test my app using react-native run-ios in the simulator, however today I just get a random error and have no clue on how to approach it since I com from web dev and have no clue on how to setup projects in xCode (well I have some idea but I don't want to further break the project)
This is the error I am getting:
libtool /Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Products/Debug-iphonesimulator/libTPSStripe.a normal x86_64
cd /Users/waltermonecke/Code_Projects/reactNative/lisdo/node_modules/tipsi-stripe/ios
export IPHONEOS_DEPLOYMENT_TARGET=10.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -L/Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Products/Debug-iphonesimulator -filelist /Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Intermediates/TPSStripe.build/Debug-iphonesimulator/TPSStripe.build/Objects-normal/x86_64/TPSStripe.LinkFileList -lRCTPushNotification -weak_framework Stripe -framework PassKit -o /Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Products/Debug-iphonesimulator/libTPSStripe.a
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lRCTPushNotification
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lRCTPushNotification is not an object file (not allowed in a library)
** BUILD FAILED **
The following commands produced analyzer issues:
Analyze /Users/waltermonecke/Code_Projects/reactNative/lisdo/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
Analyze /Users/waltermonecke/Code_Projects/reactNative/lisdo/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
(2 commands with analyzer issues)
The following build commands failed:
Libtool /Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Products/Debug-iphonesimulator/libTPSStripe.a normal x86_64
(1 failure)
I guess this is the relevant part can't locate file for: -lRCTPushNotification, but I dont know how to properly remove the reference to that package.
Any help is welcome!

Xamarin Debug -> iPhone, Failed to compile the generated registrar code. (MT4109)

I'm trying to build up my App for testing on Device.
I'm facing an huge problem with the debugging:
The device is registered
I'm using a Dev Provisioning Profile
If I build and publish "release" no problem occurs
If I build Debug / iPhone I get:
/---PATH----/MTOUCH: Error MT4109: Failed to compile the generated registrar code. Please file a bug report at http://bugzilla.xamarin.com (MT4109) (---PROJECT NAME---)
Taking a closer look to the logs:
Process exited with code 1, command:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -gdwarf-2 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/9.0.1.29/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -Qunused-arguments -miphoneos-version-min=8.0 -arch arm64 -c -DDEBUG -o /---PATH---/obj/iPhone/Debug/mtouch-cache/registrar.arm64.o -Wno-receiver-forward-class -x objective-c++ -fno-caret-diagnostics -fno-diagnostics-fixit-info -
<stdin>:3804:35: error: type name does not allow storage class to be specified
<stdin>:3804:32: warning: declaration does not declare anything [-Wmissing-declarations]
Any suggestion?
If someone stumbles over this problem as I did:
Try adding --noregistrar to the additional mtouch arguments in the project's options (iPhone Build page).

Error compiling freetype2 library for arm7 with OSX gcc: `limits.h: No such file or directory

I am trying to compile the freetype2 library for arm7, using Xcode's command line tools in OSX. I am using the following parameterisation of the project's configure script:
Compiling FreeType for iPhone?
These errors were produced when running the script:
configure:3426: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -E conftest.c
In file included from conftest.c:10:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/include/limits.h:15:25: error: limits.h: No such file or directory
configure:3426: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -E -traditional-cpp conftest.c
conftest.c:12: error: assert.h: No such file or directory
configure:3426: /lib/cpp conftest.c
/Volumes/DATA/filestore/development/libs/c/freetype2/extract/2.5.3/builds/unix/configure: line 1600: /lib/cpp: No such file or directory
configure:3465: result: /lib/cpp
configure:3485: /lib/cpp conftest.c
/Volumes/DATA/filestore/development/libs/c/freetype2/extract/2.5.3/builds/unix/configure: line 1600: /lib/cpp: No such file or directory
I can see that the missing files actually do exist in the directories output in the error messages.
CFLAGS and LDFLAGS contain the following parameter, which should allow for the inclusion of system header files:
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/
The other odd thing that I noticed with these error messages, is that the architecture identifier in the directory structures is i686-apple-darwin10. The -arch armv7 compiler flag is being used, so why are i686-apple-darwin10 directories being inspected at all?
* UPDATED *
I also tried parameterising the configure script as per another example:
https://stackoverflow.com/a/12594507/1704014
The following error terminated its execution:
checking for suffix of native executables... ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
configure: error: native C compiler is not working
This also indicates that a different target architecture (OSX 10.6) is being built against, not arm7.
Any help much appreciated.
The problem in my OSX build environment was the Xcode command line tools installation. I reinstalled the latest distribution of the tools, and was able to compile successfully from then on.
To build the freetype2 library for arm7 and arm7s architectures, I found the following suggested commands useful:
https://stackoverflow.com/a/12594507/1704014

Apple LLVM 5.0 error when building

Upon creating a new project I named it o-golfer ( same as my project name )
Then I modified the Identity name to Application
Now when building it again, I get the Apple LLVM 5.0 error, as the cached precompiled header is trying to find again
Is there a way to clear and rebuild this cached header ?
I already tried to clean and build again the project ... same error
clang: error: no such file or directory: '/Users/yves/Developpement/iOS7/OPTIMAL/o-golfer/o-golfer/o-golfer-Prefix.pch'
Here is the error log :
ProcessPCH /Users/yves/Library/Developer/Xcode/DerivedData/o-golfer-cbxwkyokboekvvbscnyxjekgcqyf/Build/Intermediates/PrecompiledHeaders/o-golfer-Prefix-dnguhwlesygrvffouxoeiklsfygm/o-golfer-Prefix.pch.pch o-golfer/o-golfer-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/yves/Developpement/iOS7/OPTIMAL/o-golfer
setenv LANG en_US.US-ASCII
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/
...
clang: error: no such file or directory: '/Users/yves/Developpement/iOS7/OPTIMAL/o-golfer/o-golfer/o-golfer-Prefix.pch'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Make sure the "Prefix Header" build setting (to get to this, click on your project file in the navigator on the left, then go into the "Build Settings" tab) is set to the correct file name.
I had the same problem, make sure you change the prefix header in your project target and in your "app_name" target and "app_tests" target as well, as one of these being different will still throw the error. Hope this helps ;)

libtool failed with exit code 1

I attempt to Create a Xcode-WorkSpace,there are there projects in it. Now the first Project is a static library base on ZBar Code Reader.I already download the source code ,now I drag the finder named "src" into my first project. When I bulid it,here is the problem:
Libtool /Users/asset/Library/Developer/Xcode/DerivedData/huishow1-efdjffeirjufbndvocvtzkrzkwss/Build/Products/Debug-iphonesimulator/libZBarTest.a normal i386
cd /Users/asset/iPhone_Tmp/ZBarTest
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool -static -arch_only i386 -syslibroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/asset/Library/Developer/Xcode/DerivedData/huishow1-efdjffeirjufbndvocvtzkrzkwss/Build/Products/Debug-iphonesimulator -L/Users/asset/iPhone_Tmp/ZBarTest/SDK -L/Users/asset/iPhone_Tmp/ZBarTest/SDK3 -filelist /Users/asset/Library/Developer/Xcode/DerivedData/huishow1-efdjffeirjufbndvocvtzkrzkwss/Build/Intermediates/ZBarTest.build/Debug-iphonesimulator/ZBarTest.build/Objects-normal/i386/ZBarTest.LinkFileList -lxml2 -ObjC -framework Foundation -lzbar -o /Users/asset/Library/Developer/Xcode/DerivedData/huishow1-efdjffeirjufbndvocvtzkrzkwss/Build/Products/Debug-iphonesimulator/libZBarTest.a
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool failed with exit code 1
Who can help me?
Sounds like a missing dependency. I'm not familiar with the ZBar code reader but I'd imagine it declares dependencies on some system frameworks that you haven't yet included in your app? Look in the docs for ZBar to determine which frameworks you need to link to when including it. Typically when you get these types of libtool errors when you don't include a framework or other dependency.

Resources