Archive

Archive for the ‘Rejection’ Category

SOLVED: Application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6

June 24, 2011 11 comments

The Problem :

I upgraded to a recent version of XCode, let us call it 4.x.x and when I submit my app to the appstore after making a release build, Application Loader slaps me in my face with this error “iPhone/iPod Touch: Application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6″
When I went to build settings for my project and saw the architecture settings, I could only see armV7. ArmV6 was completely missing and I couldn’t do anything to add armV6 back.

My 2 days of effort to solve this problem. Here goes :

  1. Tried every damn thing to resolve the architecture issue as suggested by these posts ( I have tried 10 more posts but lost the links to those :
  2. Installed the previous stable version of XCode, this completely fuc….ed! my XCode. I mean XCode wouldn’t even launch after this.
  3. Installed the latest version of XCode again, stuck with same problem
  4. Finally uninstalled latest version of XCode using this command : sudo /Developer/Library/uninstall-devtools ā€“mode=all. Don’t forget to REBOOT !! I forgot to do that and had to pay the price with 2 more hours of wasted effort.
  5. Reinstalled old stable version after SUDO command and reboot in step#4. Things started to look better, but ended up with this new problem. Basically, my project’s name disappeared from the Dropdown next to the RUN and STOP buttons in the top-left corner. I could only see the libraries I was using.
  6. Finally solved that by clicking Product –>Manage Schemes and clicking “AutoGenerate Schemes”, which added my project name back in the list

I am a happy camper now šŸ™‚ The whole point of me blogging about all this stuff is to share my experiences and help a fellow developer out there so that he/she doesn’t have to waste the same time and effort which I had to. Hope it helps someone!

Advertisements

How to check for Network Connection in your IOS apps

June 16, 2011 4 comments

The Problem :

IOS apps need to handle network connectivity very carefully. An iOS user may travel from a Wifi connection to a 3G connection to a dead spot all while using your app. For this reason, Apple is extremely strict about developers handling network connectivity problems elegantly. They will outright reject your app if it errors out due to no network.

Why doesn’t Apple do it for me?Ā 

Since this is such a common requirement, you must be wondering why IOS (even IOS5) doesn’t handle this for the app. All Apple has to do is allow developers to add a .plist setting called “NetworkRequired=1” and iOS should handle the error for you. Since, all network calls will go through iOS SDK stack, it should be able to catch the errors right?

The most obvious reason that comes to my mind about why they want you to handle the issue is – Only your App knows what to do when a network failure occurs.

  • Maybe the network failure is something which you don’t care about and the app can continue working.
  • Maybe it is a critical error and you need to notify the user about it.
  • Maybe your app can afford to retry the operation based on the nature of the network API call.

So, it makes sense for your app to handle the network issues.

The Solution :

So, the solution is very simple. First make sure that you have a helper class that you use to make every single network/API call. This way the network/API code is in one place. Easier to maintain and easier to add error handling.

In Loqly (iTunes Link), we use the below two functions to check for internet.

  • (BOOL) connectedToNetwork Ā is used when we just want to check for a network connection and not notify the user if an error occurs.
  • (BOOL) checkInternet is the same but automatically shows user an error message to notify him if no internet connection is present.

There is no rocket science here. In fact this code is available in one of Apple’s own samples and we have just used it in our app.

- (BOOL) connectedToNetwork
{
	Reachability *r = [Reachability reachabilityWithHostName:@"www.google.com"];
	NetworkStatus internetStatus = [r currentReachabilityStatus];
	BOOL internet;
	if ((internetStatus != ReachableViaWiFi) && (internetStatus != ReachableViaWWAN)) {
		internet = NO;
	} else {
		internet = YES;
	}
	return internet;
} 

-(BOOL) checkInternet
{
	//Make sure we have internet connectivity
	if([self connectedToNetwork] != YES)
	{
		[self showMessage: @"No network connection found. An Internet connection is required for this application to work"
				withTitle:@"No Network Connectivity!"];
		return NO;
	}
	else {
		return YES;
	}
}

Someone has answered this question in great detail on Stackexchange as well
WARNING: As must be obvious from the above,Ā  don’t use the IP address of a user to uniquely identify him for any purpose. Since the user could travel from wifi to 3G to edge to another wifi in minutes, his IP is likely to keep changing. UDID is a good option for this.

How not to get your IOS app rejected by iTunes AppStore

Just sharing stuff I learned from my own experience of writing IOS apps. Check out our latest app Loqly – http://loqly.me. Here is the iTunes link:http://bit.ly/e5u4jv (it is free!)

  1. Do not use a screenshot which shows your app running in an IPhone. App Store does not likeĀ images of their IPhoneĀ in the screenshots. They will reject it immediately. Just take a shot of your application ‘s screen only.
  2. Apple asks you to submit a Main Logo (512 * 512 px PNG) which shows up as the big preview in ITunes and a small logo (47 * 47 px) which should be included as part of your App Bundle. They are extremely particular about the sizes and your main logo should match the mini logo. I made the mistake of submitting two different pictures (with the same theme) but promptly got rejected.
  3. Make an application which at least in Apple’s eyes will serve some purpose to the public. I know that they rejected this app called “Pull my Finger” (and it farts) and it never made it to the App Store, because Apple said it serves no purpose. Although, with weird apps like Flashlight etc, I don’t know why some apps make it to the app store and some don’t.
  4. DO NOT use any undocumented APIs. This is a recipe for rejection right away. eg. UIProgressHUD is the most common API that people use to show hourglasses but get rejected right away.
  5. Do not write an app which provides competition to any built in IPhone apps. eg. Providing a much better Photos application will probably cause Apple to think that it is giving competition to their own photos app
  6. Do not write an app which provides functionality which is “unofficial”. You must have heard of how the app which would allow you to tether you IPhone to your computer to share internet got rejected by App Store.
  7. Also, make sure your app complies with the UI guidelines. For eg. if it takes too long to load or shows an hourglass for too long, it will get rejected. Why? Because Apple doesn’t want its users to perceive that the IPhone is slow just because your app is slow.
  8. And PLEASE FOR GOD SAKE! Don’t do this (unless your are looking for media coverage) : http://www.pcworld.com/article/163717/baby_shaker_app_approved_then_removed.html
  9. If your app needs an internet connection, but does not notify the user if there is no internet connection present, it will get rejected. Gracefully handle lack of internet connection and notify the user. See this Post for how to do this
  10. With AT&T adding 200MB and 2GB caps to the previously unlimited data plan, Apple is very mindful of the amount of data your app transmits. I don’t write media streaming apps, so no advice there. But for a typical app supported by a backend webservice, use JSON or BJSON formatĀ  instead of XML. Only pass data that is required and cache on the IOS device if possible. Three20 lib has a nice TTImage which will cache images on the device and will not request them again if they haven’t changed on the server.

App rejected because of undocumented API: UIProgressHUD

When we first released Loqly (http://loqly.me) in Dec 2010, we had used UIProgressHUD to show please wait type hourglass messages to the user when the app was doing something in the background. UIProgressHUD is the same API which Apple internally uses in their apps to show the nice translucent hourglass.

Unfortunately, Appstore took 5 minutes to slap us with a rejection. Worst part is, I had been coding all night and submitted the app at 5AM in the morning in the hopes of getting at least 3-4 hour nap. But 5:10 AM, my iPhone gave me the new mail sound. And there it was…the dreaded rejection email !! I was so tired by that time that I let my team know about the rejection and just passed out.

Next day after doing some research, I came across MBProgressHUD by Jonathan George. It is an excellent replacement for UIProgressHUD and in fact has much more functionality. We just added Jonathan’s code and we were approved in no time!!

Click here to view full size