Errors when compiling Orbotix HelloWorld - ios

While I've followed the release instructions for 1.6 b1146 to the letter, I'm still unable to get Orbotix' "HelloWorld" to compile. I'm getting a lot of "Apple Mach-O Linker Error" messages. What am I doing wrong?
UPDATE: Hmmm. Looks like Build | Mach-O Type should be set to "Static Library". All but one of my error messages went away.
Those macho types get me every time. ;-0
UPDATE 11/18/13:
OK, when using Mach-O type "Static Library" setting, there is one remaining error message:
Command /Applications/Xcode 5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1
How can I fix this?
UPDATE LATER 11/18/13:
I see in the release notes for 1.6b1146 a couple of sentences that read: "The QuickStart App Template has been removed from this release since XCode 5 is not compatible. Please use the following information to manually set up your project."
I've opened the Orbotix "HelloWorld" project and followed the instructions in the release notes, but I am still getting multiple Mach-0 errors. I am running it on my iPhone 5s, not the emulator.
Do the quoted sentences above mean that none of the Orbotix sample code in the /trunk/samples directory will work? Do I need to make my own HelloWorld project somehow by copying and pasting from the Orbotix sample code?

Phoebe719, I received word of your problems with the SDK through our customer service department. I'm sorry it took us a while for us to get back to you.
As for your issue, do you happen to be attempting to compile this onto an emulator? I myself have been baffled about the Mach-O linker errors when Xcode decides to not build to a device.
If you are building to an emulator, then I'm sorry, but there is no symbols in the iOS SDK for a mac to connect to a Sphero, and therefore, it just won't work. There is a mac SDK out there, but it is in a beta phase.
If not, then go ahead and leave a comment, and I'll see if we can't further diagnose the issue.

Phoebe - I just validated that the Sphero iOS SDK v1.6 Hello World sample compiles and executes on a 5s, 5, and 4s with no changes after downloading the Zip from https://github.com/orbotix/Sphero-iOS-SDK
Please validate that you are using a clean copy of the Hello World sample.

Related

Migrating SceneKit app from xc10 > xc11, I encounter "xcrun: error: unable to find utility "scntool", not a developer tool or in PATH"

Due to character limits in the title, allow me to elaborate on what is happening.
I have an application that builds with no warnings & errors while using Xcode 10.2.1, but I would like to test it in the latest Xcode 11 beta.
However, it produces an error during the build process, yet oddly enough, the app properly launches and is usable on a simulator.
The error:
xcrun: error: unable to find utility "scntool", not a developer tool
or in PATH
Initially, I thought it was possible that the spaces in my app's name were a problem, so I quickly renamed it to use _ in place of the spaces, but that did not work.
Rebuilding the app after I removed the spaces also shows the following warning:
copySceneKitAssets: warning: Failed to copy SceneKit assests because
scntool failed to process the following resources:
/Users/someidiot/Library/Developer/Xcode/DerivedData/Build/MyAmazingApp/Products/Debug-iphonesimulator/My_Amazing_App.app/art.scnassets/Game.scn
And yes, the file is there:
Out of curiosity, I purged my derived data in case something was causing problems there.
rm -rf ~/Library/Developer/Xcode/DerivedData
However, the same scenario as before... warnings & errors upon building, but the app successfully launches on the simulator.
My concern here is that if something is genuinely wrong, I'd like to fix it before it becomes an issue, but at the same time, the app does launch successfully.
Unfortunately, I do not have access to an iOS 13 device at this time to test on hardware.
After any new Xcode installation, or even when switching between versions of Xcode, always go into Xcode's Preferences and, under Locations, adjust the Command Line Tools pop-up menu to point to the version of Xcode you are using.
Otherwise, something like xcrun, which means "run a tool inside Xcode", will be looking in the wrong Xcode.

How to get CocoaPods-based project to work in the simulator?

I'm trying CocoaPods for the first time, because I've inherited a project that relies on it for several libraries. Articles like this one make it sound like it should all Just Work, even in the simulator.
But it's not working for me — I get an "Undefined symbols for architecture i386" for every class defined in a pod library. Moreover,there are a bunch of ld warnings along the lines of "ld: warning: ignoring file blah/blah/Build/Products/Debug-iphonesimulator/SocketRocket/libSocketRocket.a, file was built for archive which is not the architecture being linked (i386)". I get one of these for each CocoaPods library.
How do I get Xcode to build the pod libraries for the simulator (or link the correct ones, if they're being built)?
OK, I've managed to make it work, though I don't know if it requires both of these steps:
Deleted the derived data, as suggested here
In the Pods project, changed "Build Active Architectures Only" to "No" for Debug as well (it was already set to No for Ad Hoc and Release), as suggested by some of the comments here.
I know that step 1 alone didn't do it... but I don't know whether step 2 by itself would have sufficed. Certainly both of them together did the trick for me.
Adding this answer in case it's helpful to anyone.
To my surprise, it was the simulator version that I was using; iPhone 5 wasn't supported. Xcode gave me no sign of this until I switched to an iPhone 6 simulator, which worked. When switching back to iPhone 5, Xcode then complained that "MyApp does not have an architecture that iPhone 5 can execute."
This is all true and I knew that, but I didn't think of it as the previous error Xcode was giving me was that -lPods-MyApp was missing.

Alamofire error: Command /usr/bin/codesign failed with exit code 1 No such file or directory & umbrella header for Pods-Alamofire-umbrella.h

i'm trying to Archive my app according to Apple's "App Distribution Guide", app is operating fine both on simulator and iPhone, no errors found. But when i just click Archive, two errors always happen:
one says:
Swift Compiler Warning: Umbrella header for module 'Alamofire' does not include header 'Pods-Alamofire-umbrella.h'.
second says:
/Users/applejwo/Library/Developer/Xcode/DerivedData/Cloud-eixkwmelyvsoqvabyduxipaohojy/Build/Intermediates/ArchiveIntermediates/Cloud/IntermediateBuildFilesPath/UninstalledProducts/Alamofire.framework: No such file or directory
Command /usr/bin/codesign failed with exit code 1
the second error sometimes may disappear, i also don't know why?
i have tried every possible solution stated in "command/usr/bin/codesign failed with exit code 1- code sign error", but errors are still there.
my dev environment is: simulator 8.4, iPhone 5s iOS 8.4, Xcode 6.4 (6E35b), swift, Alamofire 1.2.3, cocoa pods 0.37.2
Thanks very much in advance!
This is a blockheaded mistake to make, but in case anybody else is equally blockheaded: The Alamofire framework has two versions, one for iOS and one for OSX. From the Alamofire doc:
Select the top Alamofire.framework for iOS and the bottom one for OS X.
Selecting the wrong one will let the project build correctly on the simulator, but will produce the exit code 1 error when trying to archive.
After days of looking on Github and stackoverflow, it seems the problem of cocoapods, pls see here github.com/CocoaPods/CocoaPods/issues/3200;
My solution is updating the cocoapods to 0.38.0.beta.2, But just not enough to me, as it reports errors again;
So i reinstalled my pods Alamofire and swiftyJSON.
Finally errors are fixed, project Achieved successfully! I don't know why, but hope the solution works for you, it's really depressing by stuck at the final step to AppStore.
I am getting these two problems using Xcode 7 beta 2 and using Swift 2.0. I'm also using the swift-2.0 branch of Alamofire.
I was able to get rid of the second error by revoking my certificate and creating a new one. I happen to have just transferred to a new Mac and I restored it from a Time Machine backup of my old work computer, so I guessed that the code signing errors came from that.
The first error, I still have and I have no idea how to fix it. Will update this answer when I do.

Xcode 6.01 Archive validation error: Invalid Segment Alignment

I have been working on an iOS project solely in Xcode. Deployment target is iOS 8.0. After updating to Xcode 6.x, building and testing on my iPhone 5s and iPhone 6 as well as the simulators works fine. However, when I create an archive and want to validate it, I get the following error:
Archive validation failed due to the issues listed below.
iTunes Store operation failed.
Invalid Segment Alignment. This app does not have proper segment alignment and should be rebuilt with the latest version of Xcode. Please contact Developer Technical Support if you need further assistance.
I have googled for the past couple of days and it seems that this problem mostly occurs in connection with other development tools, especially from Adobe. However, I have only used Xcode for development.
This is what I have tried so far:
Reinstalling Xcode 6.01
Turning Autolayout on and off
Set target from 8.0 to 7.1
Just submit the archive (no error message, but new version is not found in Testflight)
Unfortunately, none of this has worked. My questions:
What does the error message want to tell me?
Has anyone any idea how to solve this problem?
Thanks a lot!
I found the solution. XCode seems to have lost track of two of my files (XX.h and XX.c) This file name (with a .o extension) was in the summary of the 1st step of the validation.
I removed the references to both files, added them again and everything works fine. Hope that helps someone!
(Edit: sorry, cannot flag this answer as the right answer, will do so in two days when stackoverflow lets me)
More detailed instructions:
When pressing "Validate" in the Organizer, look at the "Summary" dialog that pops up
If there are any .o files listed in addition to your app, go back to Xcode and remove the corresponding .h AND .m files from your project (removing the reference is sufficient)
Re-add them by dragging and dropping them back into your project
Recompile and it should work (assuming you're not using Adobe Air components in your app)
(thanks a million for this post Fynh, your fix made it finally work for me!)
In my case I was submitting an app that include a framework I had built that was a universal framework - created using lipo (for use with both device and simulator).
After replacing the universal compiled framework with device compiled framework, validation was successful.
To fix this bug I had to go Targets / Build Phases / Expand Copy Bundle Resources and remove the empty.cpp file (my error was about a empty.o file)
Hope this helps someone

Cordova 3.4, Xcode 5.1 and iOS 7.1

I was building my project perfectly but after updating iOS to 7.1, I was then forced to update Xcode 5.1 and now I'm getting error and warning messages:
4S 7.04 – builds – no error or warning messages
5S 7.1 – doesn’t build – mixture of error and warning messages:
26 x Value conversion issue
Implicit conversion loses integer precision:
12 x Linker build errors
Then I do the steps outlined in this blog post to remove linker errors – delete all conditional architecture and make sure arm64 is in the all the projects and targets: http://shazronatadobe.wordpress.com/2014/03/12/xcode-5-1-and-cordova-ios/
4S 7.04 – builds – warning messages:
12 x Format String Issue
Values of type ‘NSInteger’ should not be used as format arguments; add an explicit cast to ‘long’ instead
5S 7.1 – doesn’t build – warning messages:
26 x Value conversion issue
Implicit conversion loses integer precision:
12 x Format String Issue
Values of type ‘NSInteger’ should not be used as format arguments; add an explicit cast to ‘long’ instead
I think the warning messages are now affecting the badges as they are not reseting correctly
Are the warning messages relevant? And would they likely be affecting resetting the badges?
Okay, so I have gone back and forth with this for a while and I've got a few possible solutions for you.
Make sure in Xcode you are selecting both your project and the target within that project also and make sure your settings are setup like the forum post you mentioned.
Make sure you also change the settings on the CordovaLib project as well. Both the project and the target need to be changed, but it's slightly different. you also need to add i386 as a supported platform in the cordova project, but is not needed in yours.
Other things to check are.... Make sure you are using the right kind of provisioning profile... ie. Distribution for production phone builds and Development for team builds and testing on your device.
Check and make sure you are not missing a library you needed to import. You can usually tell if you are missing a library by the mach-o linker errors though.
Example: I removed a plugin from my phonegap project via command line. Well then I added it back and my project would not build using the 'phonegap build ios' command. I had to open the XCode version of my project within xcode then re-import the AudioToolbox library under the Linked files and then I was able to build again via command line.
Good luck, comment here if you need more help.
Please check my attached images might be it will helpful for you.

Resources