RhoStudio Doesn't Build In XCode - Curl - iphone

Me and my friend are creating an app on RhoStudio and we would like it to work on Apple devices.
It works perfectly on Android, IOS Simulator but isn't compiling correctly to be able to run it on my iPhone via XCode.
When I do make an XCode project with it the project ($ rake build:iphone:setup_xcode_project) there are 3 errors and since im not that advanced at XCode do not understand the errors.
The errors are related with Curl.
I'll be really appreciated if we could get some help.
Details
- Motorola RhoStudio: 4.0.0
- MacBook Pro 2011, v10.9
- XCode v5.0.2

The strlcat method changed definition in iOS 7 and Mavericks. It is already defined in the system headers and this definition conflicts with the one in the cURL source.
By looking at the system header, I think you could solve this in a number of ways
Change target SDK to 6.1, or something earlier than 7.0. This is a quick fix, but might not be what you want.
Remove the definition in the cURL source (there seems to be no way to #define away it so you need to edit the source).
-D_FORTIFY_SOURCE =0 should disable all Apple's definitions (did not try this though).

Related

iOS 6 WebDriver compilation

I tried to compile Selenium WebDriver for iPhone 6.1.3 and got some errors, like
Objective-C declarations may only appear in global scope
in HTTPVirtualDirectory+FindElement.mm file.
I use XCode 4.6.2 , iOS 6.1 SDK and WebDriver sources from https://code.google.com/p/selenium/
Someone compiled WebDriver for iOS6 successfully? Had you same problem?
Also, if you have any useful information about automated web testing on real devices (iPhone with iOS 6) please, share it with me =)
I have not used the iOSDriver but it is now deprecated in favor of something else, specifically the ios-driver created by a third party:
http://freynaud.github.io/ios-driver/
I would set that up, come back if you have any further questions.
Go to https://code.google.com/p/selenium/wiki/IPhoneDriver
take trunk from https://code.google.com/p/selenium/
Add project from trunk to Xcode
In Xcode Build and run thorugh Iphone 6.1 Emulator
P.S i think that will help you

App crashes with 4.2 iPhone simulator 'set start-with-shell off'

I'm writing application which perfectly works on 4.0/4.1 iPhone simulator, but not 4.2.
I'm getting such warning:
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
fcntl$UNIX2003 called from function get_socket_nonblocking in image TestApp.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.
How to set 'set start-with-shell off' on Xcode? I'm tried to add this line to .gdbinit but without luck.
With 4.0/4.1 SDK iPhone Simulator prints warnings about attempt to call symbol that is not present on the iPhone in debug window, but app don't crashes. Using using 4.2 app crashes. How to prevent 4.2 crashes ?
Thanks
before this cleanAll build then
In xcode go to Project > set active executable > appname - Iphone 4.0 simulator
then open simulator then go to Hardware > version > 4.0.2
then double click urapptarget and in build tab change "ios deployment target = 4.0"
now run in simulator it will work
File a bug via http://bugreporter.apple.com/
The debugger within Xcode will read ~/.gdbinit just like gdb at the command line. Try adding that line to ~/.gdbinit.
I had a similar problem with a version of libCURL that was built for an earlier OS. The solution was to rebuild the library under iOS 4.2 to eliminate the $UNIX2003 symbol decorations. (I wrote up the full details at http://www.creativealgorithms.com/blog/content/building-libcurl-ios-42.)
I was also unsuccessful adding the line to ~/.gdbinit. At the risk of stating the obvious: if you set the simulator version to 4.1 within XCode, you'll avoid the issue. This is what I do now - which is fine as long as I don't need to test an API available only on 4.2 - which we do not (we still target iOS 3.0).
I encountered a similar error:
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pthread_rwlock_init$UNIX2003 called from function ...
I was able to fix by unchecking the 'Strip linked Product' Deployment Build Setting of the Project, ie STRIP_INSTALLED_PRODUCT = NO
Don't forget to do a full clean before rebuilding.
You probably only want to do this for the simulator. Filling a bug report is still a good idea.
If you are using native libraries, you should recompile them using iOS4 (only the i386 versions, as it works on the device).
The $2003 suffix is generated by the compiler under some circumstances which you can find fully documented in the manual entry for compat
man compat
I wrestled with this for some time before finally fixing it by setting
-mmacosx-version-min=10.3
Any version prior to 10.4 will do the job.
Hope this helps.

iPhone OS Deployment Target after update to iPhone SDK 4

I just updated to iPhone SDK 4 and am trying to debug on my device with 3.1.3 installed. Before the update, I compiled with Base and Active SDK set to 3.1.3 and all was well. After the update, I'm limited to SDKs 4.0 and 3.2--setting the base to 4.0 and iPhone OS Deployment Target to iPhone OS 3.1.3, I'm able to build and install on my 3.1.3 device, but receive the following error:
Error from Debugger: mi_cmd_stack_list_frames: Not enough frames in stack
I'm not using anything specific to the newer SDK, as I haven't touched a bit of code, just updated the SDK/XCode. So what am I doing incorrectly? The application runs as expected on an iOS4-installed device. Are there changes to pre-existing API's that need to be weakly linked perhaps? Thanks for all help.
Have you tried removing the app completely from your dev device, doing a build -> clean all targets, and then build again to your device?
I found this answer on macforums. If it's correct, then you probably have a memory corruption problem in your app that is confusing the debugger. Perhaps over-releasing something somewhere.
This probably isn't related to the SDK you are compiling with. It's possible you had this problem in your app all along but it just didn't show up until things moved around with the new Xcode, SDK, etc.
EDIT - I just ran into this problem myself trying to update an older app of mine to 4.0. It would run fine in the simulator and would install and run on the device except it wouldn't run in the debugger on the device. Anyway, I finally decided it was the .xcodeproj file that was corrupt or bad in some way and created a new project, copied over my source files to the new project and now it all works again. It's a pain but it only took about 20 mins to duplicate all my settings and I spent a couple hours trying to get the debugger to work.
Myself (and probably many others) are concerned about "will I still be able to compile/install apps for v3.1.3 of the iPhone OS?"
And what version of xCode does it become IMPOSSIBLE to ever write v3.1.3 apps again?
(Without installing a second copy of an older version of xCode.)
I've read the mile-long document that Apple wrote on the subject... but it sure would be simpler to understand if they just LISTED the various versions of each... instead of writing long paragraphs.
If you have:
Mac OS version 10.x.x x
xCode version x.x.x
SDK version(s) x.x.x
you can produce apps for iPhone OS x.x.x through x.x.x?

Older SDK disappeared after installing new Xcode version

Why are old SDKs beeing removed when installing a new version of xcode with new Iphone SDK ?
Now we have v4, what settings do I have to make in order that the apps still work with 3.x ?
Thanks
Set the Base SDK to 4.0 and Deployment Target to 3.x. Or, in modern conditions, the Base SDK to Latest and Deployment Target to whatever you need.
Although 'Zoul' has most succinctly answered the question, I shall make an attempt to elaborate on the 2 settings and point to some useful documents which will help others who are new to the situation.
Base SDK Version: This indicates the version of the SDK based on which the program has been compiled. This can be set from the "Build Settings" for the project or target. You can use API code from Apple in your code introduced up-to that version and compiler will know all the symbols and compile without any issues.
Deployment target: This is a declaration from your side about the minimum iOS version which should be installed on the user's device to run your code. This setting can be found under "Info" section for Project and "Summary" section for a particular target. Now, important thing to understand is that your code will not automatically run smoothly on devices with older versions of the iOS if you are using API code introduced in later version by Apple. These can be new classes/methods/frameworks introduced by Apple in later version. You have to ensure by writing necessary conditional code and provide alternate code path to gracefully degrade for older iOS version which does not have the newer API. It is up-to you to handle version incompatibilities.
Apple documentation on the subject can be found in "SDK Compatibility Guide".
To know about the changes with different versions of iOS refer "What's new in iOS".
This topic is also discussed in "iOS Development Guide" under section "Building and Running Application". Refer sub-section "Specifying the Runtime Environment".
If you have backups of your system from something like Time Machine (and you better!) you can copy the older SDKs from the backup located at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs - then just restart XCode and you're ready to go.
If you still have the problem after you set Deployment target at least as low as your desired SDK, then you need to download that SDK. Luckily, Xcode helps us here also:
look after Simulator selector in top left of your Xcode and select More Simulators. It will open a page like the one below:
just select the SDK you need to test your app against.
3.2.3 last beta did remove all other SDK's cause to many people tried publish Apps developed with the beta SDK, which will not be accepted. I guess GM is doing still the same
If you want to develop for 4.0,3.2 and 3.0 (plus 3.0,3.1,3.1.2,3.1.3)
do the following
sudo /Developer/Library/uninstall-devtools –mode=all (This will uninstall the current XCode installation)
Then install first old XCode (3.2 final) in default folder (/Developer)
Then install the new XCode (3.2.3 GM) in other folder (/DeveloperBeta)
This way you will have both. And can launch xcode from either /Developer/Applications/Xcode.app or /DeveloperBeta/Applications/Xcode.app

Compiling for iPhone 2.2.1 using Xcode

I have been developing an iPhone app. and had the Base SDK set to "iPhone Device 3.0" and Deployment target set to "iPhone OS 3.0". Everything worked fine. I recently realised I actually needed to compile the project to run on devices using version 2.2.1 of the SDK, so I set the deployment target to "iPhone OS 2.2.1". Now when I hit compile I get 2079 errors all eventually pointing back to my header files saying "#endif without #if". My header files are surrounded by #ifndef/#endif clauses and I have checked every single one of them and all of these match up (since it compiles targeting 3.0 I'm assuming this isn't the problem anyway). I am using XCode 3.1.3. I have no idea what is going on and would appreciate any help with this. Thanks.
First thing to check is that you aren't using libraries that are only available in the 3.0 SDK. If you are using the MPMediaPlayer Framework, for example, you will probably get some compile warnings since those libraries don't exist prior to the 3.0 SDK.
My general advice for compile errors is to start with the first error and work your way one at a time. Generally, a single failure at the top will cascade and cause many more compile errors than actually exist in your code.
I found the answer, I had the target SDK set to the wrong version (2.2.1), when it should have been set to 3.0.