Xcode can't compile XIBs - objective-c

I'm getting the below error message and multiple XIB compilations failing with exit code 6. I can't make much sense of it. Anyone know what might be wrong?
I've cleaned the project, but that didn't help.
The errors only happen when archiving, not when simply running the app. EDIT: Scratch that, after I did the build (and clean), running no longer works.
CompileXIB MyProject/en.lproj/MainMenu.xib
cd /Users/wesley/XCode/MyProject
setenv XCODE_DEVELOPER_USR_PATH /Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text --compile /Users/wesley/Library/Developer/Xcode/DerivedData/MyProject-ciandcogabqifsfgbscfrfgabfet/Build/Intermediates/ArchiveIntermediates/MyProject/InstallationBuildProductsLocation/Applications/MyProject.app/Contents/Resources/en.lproj/MainMenu.nib /Users/wesley/XCode/MyProject/MyProject/en.lproj/MainMenu.xib --sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
2013-04-09 09:48:22.377 ibtoold[77454:1207] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilder/IDEInterfaceBuilder-3084/ibtool/IBToolErrorForwarder.m:32Details: Unhandled error: 13Object: <IBToolErrorForwarder: 0x401036100>Method: -initThread: <NSThread: 0x40030a1e0>{name = (null), num = 1}Hints: NoneBacktrace: 0 0x000000010c04c7c3 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in DVTFoundatio 1 0x000000010c04c5f4 _DVTAssertionFailureHandler (in DVTFoundatio 2 0x000000010b571bba (in ibtool 3 0x000000010b569115 (in ibtool 4 0x000000010b563f74 (in ibtool 5 0x00000000000000Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool failed with exit code 6

ASSERTION FAILURE CAUSES :-It could be the file you are opening or corrupted preferences. Try deleting preferences or opening a known good nib/xib file.
Also
Deleting everything in your "Derived Data" folder
Clean your project.
More similar question xcode won't compile iOS apps, crashes when .xib or .storyboard files are opened helps you!
Also Try
removing all *.xcdatamodel directories that are not displayed in XCode from your *.xcdatamodeld directory. These directories appear after *.xcdatamodel renaming in XCode.

Related

library not found for -lReact

I'm getting this error in all my app builds now and I can't seem to figure it out.
I am using the .xcworkspace file
I had to rename the app. Used: react-native-app-id ...
This morning I was able to build/run on emulator. I tried to setup xcode to run on an actual device and now the universe hates me.
I can't even react-native start and react-native run-ios without getting these errors:
ld: warning: directory not found for option '-L/Users/gmike/Projects/promiscue/tribeoffive/TribeOfFive/ios/build/Build/Products/Debug-iphonesimulator/React'
ld: library not found for -lReact
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/tribe-of-five.app/tribe-of-five normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/tribe-of-five.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/tribe-of-five.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I've checked out a bunch of other stackoverflow articles.
I think this is telling:
Thoughts on how to un-mess up my env?
The error goes away when you remove libReact.a from the Xcode file tree (for me, it was under the Frameworks folder).
I also removed other files (they all had a transparent/white overlay on them which probably mean they were missing, actually couldn't open them in the finder neither)
Ok let's resolve this:
What to look for:
Here's a list of all the sub projects (or their products) that will cause XCode to throw that error when building a react-native project w/ cocoapods:
[
RCTActionSheet,
ART,
RCTBlob,
RCTCameraRoll,
RCTGeolocation,
RCTImage,
RCTLinking,
RCTAnimation,
RCTNetwork,
RCTPushNotification,
RCTTest,
RCTSettings,
RCTText,
RCTVibration,
RCTWebSocket,
]
Where to look for those weird project names:
First of all you'll look in the actual error message.
Here's a typical library not found error
Notice the ... /libART.a part?
That fellow is causing that error on my end.
In your case it can be any of the strings in the array above.
Found the troublemaker, what to do now?
Step 1: Remove the troublemaker project.
Let's try the lucky shot first:
Open the Project Navigator, and check if you can see the linked project that corresponds to the troublemaker string. In my case it was an XCode project called ART.
If you find it there, just remove it's reference, and you should be fine.
If that didn't work:
Open {Project Target} > Build Phases > Link binary with libraries and check wether you can see the troublemaker string in there. (It could be something like libArt.a depending on what's causing the issue on your end)
If that worked, forget the next step, otherwise move on:
Step 2: Delete the derived data directory, clean and rebuild
In my case (as seen in the raw error above) the derived data directory was /Users/sudoplz/Library/Developer/Xcode/DerivedData/MySuperApp-haxjchilyksewvdfcnnxwrulvyvy/Build/Products/Debug-iphonesimulator/
find yours in the error log, and delete it.
You can then clean XCode, shut it down, launch it again, and re-build.
Hopefully that should either fix the issue, or help you move on with fixing other stuff that may have gone wrong.
That's all folks.
Try to add that file to the libraries by finding libReact.a from the project, then clean and run Xcode.
or
Try to add libReact.a to your project "Build Phases" > Link binary with libraries, then clean and run Xcode.

facing this error while building a project in xcode

facing this error while building a project in xcode
warning: unable to merge a subprocess's serialized diagnostics
error: unable to open output file '/Users/s-09/Library/Developer/Xcode/DerivedData/ls-cujvtldtpxrezhdhbujnmfcrntjl/Build/Intermediates/CordovaLib.build/Debug-iphoneos/CordovaLib.build/Objects-normal/armv7/CDVPluginResult.o': 'Error opening output file '/Users/s-09/Library/Developer/Xcode/DerivedData/ls-cujvtldtpxrezhdhbujnmfcrntjl/Build/Intermediates/CordovaLib.build/Debug-iphoneos/CordovaLib.build/Objects-normal/armv7/CDVPluginResult.o': Input/output error'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Cleaning the /DerivedData made it work
Can I safely delete contents of Xcode Derived data folder?
I have also faced that problem. I have closed, restarted Xcode; deleted the application from device and reinstalled it again, then the problem has gone.
Make sure the library and project files is truly included if it is not include it shows in red color in this type of case some time it is in original folder and not in project so delete it and add it again.

Connecting HTTPKit to a Theos application project. Undefined symbols error

Aim
I am trying to build the simplest Theos application that is acting like HTTP server.
I have no specific preferences on what libraries to use, but I tried by best using HTTPKit this time. I will appreciate any comments and/or links on how to build such applications.
Question in a couple of words
Failed to use HTTPKit in Theos application project. Getting "Undefined symbols" when using any of the HTTPKit classes.
Personal thoughts
I am sure the "Undefined symbols" error is caused by wrong linking. And I am almost sure that it has to do something with the dependencies folder since I have no idea where to put it and how to link it.
It's not completely neccessary to use HTTPKit, but I am having quite the same troubles trying to implement CocoaHTTPServer in Theos application.
I will also appreciate any comments on what I am doing wrong while installing Theos and making applications.
How I installed and configured Theos
Installed Theos using the following guide
Downloaded everything from one of the headers repository into
$(THEOS)/include
Downloaded (additionally) IOSurfaceAPI.h from here into
$(THEOS)/include/IOSurface
Making a simple project
1.Created a Theos application using NIC
cd ~
$THEOS/bin/nic.pl
NIC 2.0 - New Instance Creator
------------------------------
[1.] iphone/application
[2.] iphone/library
[3.] iphone/preference_bundle
[4.] iphone/tool
[5.] iphone/tweak
Choose a Template (required): 1
Project Name (required): name
Package Name [com.yourcompany.name]:
Author/Maintainer Name [***]:
Instantiating iphone/application in name/...
Done.
2.Put the whole repository HTTPKit into newly created folder
~/name/HTTPSources
3.Added the following line
name_FILES += $(foreach ext, c cpp m mm x xm xi xmi, $(wildcard
HTTPSources/*.$(ext)))
into the Makefile, so it looks like this
4.Put all files from here into newly created
$THEOS/include/HTTPKit
5.Now the $(THEOS) folder looks like this
6.Calling make now doesnot cause fatal errors (except ldid command, which I guess is not vital) resulting in
~/name/theos/makefiles/targets/Darwin/iphone.mk:41: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for application name...
Copying resource directories into the application wrapper...
Compiling main.m...
Compiling nameApplication.mm...
Compiling RootViewController.mm...
Linking application name...
Stripping name...
Signing name...
/bin/sh: ldid: command not found
Trying to use HTTPKit, getting errors
1.Added HTTPKit import and a few simple lines from the example
HTTPServer * serv = [[HTTPServer alloc] init];
[serv handleGET:#"/hello/*"
with:^(HTTPConnection *connection, NSString *name) {
return [NSString stringWithFormat:#"Hello %#!", name];
}];
into ~/name/main.m so it looks like this
2.Now calling make causes "Undefined symbols for architecture armv7" error
~/name/theos/makefiles/targets/Darwin/iphone.mk:41: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for application name...
Copying resource directories into the application wrapper...
Compiling main.m...
Linking application name...
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_HTTPServer", referenced from:
objc-class-ref in main.m.f3071598.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [obj/name.app/name.ba964c90.unsigned] Error 1
make[1]: *** [internal-application-all_] Error 2
make: *** [name.all.application.variables] Error 2
Additional info
find ~/name
make clean all messages=yes
Try adding
export ARCHS = armv7 arm64
export TARGET = iphone:clang:7.0:7.0
to your makefile.
That fixed a similar error for me. If the error is different would you be so kind as to post the output?
I think you missing library. You only have HTTPServer header but lack of implement. Compile HTTPKit and put it on $THEOS/lib. Then add name_LIBRARIES = nameoflibHTTKit in Makefile

GHUnit target: failed to attach to process

I have a GHUnit test target, TestGH, which I'd like to use to test classes in my application, TestApp. I'm using Xcode 4.5 and trying to run TestGH on iPad 6.0 Simulator.
I believe I've configured the TestGH build correctly in the Build Settings and Build Phases. I've set the Target Dependencies to "TestApp" I've added the *.m files for the classes I'd like to test--along with the test case classes which will test them--to the Compile Sources section TestGH.
Other notable configuration:
In the app target, TestApp:
Symbols Hidden By Default: No
Product Name: TestApp
In the test target, TestGH:
Bundle Loader: $(BUILT_PRODUCTS_DIR)/TestApp.app/TestApp
Mach-O Type: Bundle
Other linker flags: -ObjC, -all_load
Product name: TestGH
Test Host: $(BUNDLE_LOADER)
I suppose I have this mostly right, as I discovered these settings by fighting through compile/link errors, reading stackoverflow, and blogs.
However, when I launch TestGH, the Log Navigator shows:
error: failed to attach to process ID 2305 (2305 corresponds to 'sh' according to activity monitor, fyi)
Simulator screen remains black, and Xcode shows "Attaching to TestGH" in the status.
Any ideas?
I've gone through many suggested fixes/workarounds I've seen discussed here related to "failed to attach to process."
Deleted DerivedData folder in Library/Developer/Xcode, deleted everything under Library/Application Support/iPhone Simulator. Tried all the options under Product->Edit Scheme for the TestGH target--tried Debugger = GDB, LLDB, None, Launch = Automatically, wait. Results are always the same.

Can't build any MonoMac samples on MonoDevelop 3.0 in OS X

I just did a clean install of MonoDevelop 3.0 in OS X (10.7.2) and then did a Git checkout of MonoMac. I can't build any of the samples included in the MonoMac repository, and I get the same error every time after the output says the build succeeded:
Build failed. Object reference not set to an instance of an object
Full sample build output:
Cleaning Solution: Fire (Debug)
Cleaning: Fire (Debug)
Removing output files...
Clean complete
Building Solution: Fire (Debug)
Building: Fire (Debug)
Performing main compilation...
/Library/Frameworks/Mono.framework/Versions/2.10.9/bin/dmcs /noconfig "/out:/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.exe" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Core.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.Linq.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Drawing.dll" "/r:/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoMac.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 "/define:DEBUG" /t:exe "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/MainWindow.cs" "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/MainWindowController.cs" "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/MainWindow.xib.designer.cs" "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/Main.cs" "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/AppDelegate.cs" "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/MainMenu.xib.designer.cs"
Compiling interface definitions
/Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text --compile "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.app/Contents/Resources/MainWindow.nib" "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/MainWindow.xib"
/* com.apple.ibtool.document.warnings */
/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/MainWindow.xib:2: warning: Content rectangle not entirely on screen with the menu bar (May not be completely visible for all screen resolutions and configurations) [9]
/Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text --compile "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.app/Contents/Resources/MainMenu.nib" "/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/MainMenu.xib"
Copying content files
Copying '/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.exe' to '/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.app/Contents/MonoBundle/Fire.exe'
Copying '/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.exe.mdb' to '/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.app/Contents/MonoBundle/Fire.exe.mdb'
Copying '/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoMac.dll' to '/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.app/Contents/MonoBundle/MonoMac.dll'
Copying '/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/fire.png' to '/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.app/Contents/Resources/fire.png'
Copying '/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/smoke.png' to '/Users/dave/Dropbox/Code/MonoMac/monomac/samples/Fire/bin/Debug/Fire.app/Contents/Resources/smoke.png'
Build complete -- 0 errors, 0 warnings
Updating application manifest
---------------------- Done ----------------------
Build successful.
Build failed. Object reference not set to an instance of an object
What am I doing wrong here?
This is a known issue. The problem is that MonoDevelop cannot find the MacOSX sdk's on your system (presumably you are using an Xcode version older than 4.3?).
I'm working on a fix for this for MonoDevelop 3.0.2
For me, it was the fact that I had a conflict in a Info.plist file that the IDE couldn't identify was bad. Just had to resolve the conflict and rebuild.