iOS App Got Rejected...

naphatkrit

macrumors member
Original poster
Jul 18, 2011
38
0
My App was rejected earlier today because it crashes on an iPhone before the application can launch properly. Oddly enough, I can't reproduce the effect on my debugger. I am assuming that this is because the problem only occurs the first time the app launches, which doesn't happen when Xcode compiles the app. (I coded my app to perform a method when the app launches, and if it's the second time the app launches, it does the method in background instead of foreground.) This is the crash log from Apple.

Code:
Incident Identifier: 711FEC0C-7933-411E-ADF5-0EC9289ABFD0
CrashReporter Key:   d4365cbed4fa63fb6536c6c6925416357a62e6e7
Hardware Model:      iPhone3,1
Process:         EIS SC [1292]
Path:            /var/mobile/Applications/10CA1577-9D5A-4047-8C17-661A66342688/EIS SC.app/EIS SC
Identifier:      EIS SC
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2012-01-16 16:28:35.033 -0800
OS Version:      iPhone OS 5.0.1 (9A405)
Report Version:  104

Exception Type:  00000020
Exception Codes: 0x8badf00d
Highlighted Thread:  0

Application Specific Information:
com.eis.eissc failed to launch in time

Elapsed total CPU time (seconds): 5.370 (user 5.370, system 0.000), 26% CPU 
Elapsed application CPU time (seconds): 0.807, 4% CPU

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib        	0x362a0010 0x3629f000 + 4112
1   libsystem_kernel.dylib        	0x362a0206 0x3629f000 + 4614
2   CoreFoundation                	0x3436941c 0x342dc000 + 578588
3   CoreFoundation                	0x34368154 0x342dc000 + 573780
4   CoreFoundation                	0x342eb4d6 0x342dc000 + 62678
5   CoreFoundation                	0x342eb39e 0x342dc000 + 62366
6   CFNetwork                     	0x323fde0c 0x32398000 + 417292
7   Foundation                    	0x35ceb4b6 0x35cdb000 + 66742
8   Foundation                    	0x35d0f366 0x35cdb000 + 213862
9   Foundation                    	0x35d40184 0x35cdb000 + 414084
10  Foundation                    	0x35d84c70 0x35cdb000 + 695408
11  EIS SC                        	0x000cb2f4 0xbf000 + 49908
12  EIS SC                        	0x000c0be8 0xbf000 + 7144
13  EIS SC                        	0x000c0534 0xbf000 + 5428
14  UIKit                         	0x377767e4 0x3773b000 + 243684
15  UIKit                         	0x377703b6 0x3773b000 + 218038
16  UIKit                         	0x3773e91a 0x3773b000 + 14618
17  UIKit                         	0x3773e3b8 0x3773b000 + 13240
18  UIKit                         	0x3773dd26 0x3773b000 + 11558
19  GraphicsServices              	0x30b70dec 0x30b6c000 + 19948
20  CoreFoundation                	0x3436954c 0x342dc000 + 578892
21  CoreFoundation                	0x343694ee 0x342dc000 + 578798
22  CoreFoundation                	0x3436833c 0x342dc000 + 574268
23  CoreFoundation                	0x342eb4d6 0x342dc000 + 62678
24  CoreFoundation                	0x342eb39e 0x342dc000 + 62366
25  UIKit                         	0x3776f450 0x3773b000 + 214096
26  UIKit                         	0x3776c73c 0x3773b000 + 202556
27  EIS SC                        	0x000c03be 0xbf000 + 5054
28  EIS SC                        	0x000c0368 0xbf000 + 4968
I looked up the exception code and it seems to indicate that the app took too long to start. Does anyone have a suggestion? Thank you all in advance.
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
I notice a reference to CFNetwork in the stack trace. Are you attempting to do network communication at launch? What happens if that network communication fails or is too slow?
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,660
4,200
Simply deleting the app from the simulator and installing again will make it behave like its the first time again...

Try it with wi-fi turned off, to see how well it works without an internet connection like jimi suggested.
 

naphatkrit

macrumors member
Original poster
Jul 18, 2011
38
0
I notice a reference to CFNetwork in the stack trace. Are you attempting to do network communication at launch? What happens if that network communication fails or is too slow?
You're right, the app downloads some data at launch. What I did is to run the downloading code in foreground if it's the first time launching the app, and background if it's not (downloaded data is saved for offline use, so if there is no connection, it will just use the data already downloaded earlier). I believe this may be the cause for the crash, but Apple did say in the resolution center that the app is tested under both wifi and cellular data connection.
 

seepel

macrumors 6502
Dec 22, 2009
471
0
Do you have the symbolic binary file? Forgot what it's called. Google "interpreting crash dumps iOS" I'm sure find a tutorial to make sense of the crash you got from Apple.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93

naphatkrit

macrumors member
Original poster
Jul 18, 2011
38
0
http://www.google.com/search?as_q=0...cct=any&safe=off&tbs=&as_filetype=&as_rights=

Your app was killed by the watchdog because it took too long to launch. I think it's ten seconds. You should symbolicate it because I can see some of your app's code in the stack trace, but basically you're doing something that takes too long when it launches. Don't do that.
In that case, would it help if I use the method performSelectorInBackground in applicationDidFinishLaunching instead?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
24,873
219
Harrogate
In that case, would it help if I use the method performSelectorInBackground in applicationDidFinishLaunching instead?
Yes. If you absolutely need this data before the app can do anything then display a screen saying something like "Downloading data for initial usage" whilst you download the data on the first run. If your app can be used without the data then just do it in the background like you do on subsequent executions.
 

ppilone

macrumors 6502
Jan 20, 2008
361
0
NEVER perform blocking code in applicationDidFinishLaunching methods. If you browse the dev forums you'll see this mantra over and over again.

The usual solution for this is to use GCD to kick off a block of code that will execute asynchronously on a global thread. If you're unfamiliar with using GCD and blocks in this way I'd suggest taking a look at the GCD docs.
 

naphatkrit

macrumors member
Original poster
Jul 18, 2011
38
0
Ok, I resubmitted the app with the background code instead. It's been "In Review" (not "waiting") for almost 24 hrs now. *fingers crossed* I hope it gets approved.
 

naphatkrit

macrumors member
Original poster
Jul 18, 2011
38
0
I was surprised too, it happened in less than an hour after I uploaded. I wonder if it's because I resubmitted the same day the old one got rejected?
 

naphatkrit

macrumors member
Original poster
Jul 18, 2011
38
0
Seems strange. Normally resubmission puts you to the back of the line. Oh well, good for you!
Haha lucky me, I guess.

Just out of curiosity though, how long does an app stay In Review nowadays? It's been over a day and it's still In Review.
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
I guess.


My experience lately has been less than an hour.


And then the luck runs out...
Err, what!?
Last time, it took 2 weeks review time (took about 4 days to actually go into review). And then after 2 weeks I got rejected because they "suspected" I was stealing 3rd party things, while I had all the rights to myself.
So I resubmitted while using some copyright logo's, then took only 2 days for going into review, and after a week, they did another reject for same reason.. Was pulling my hairs.. but since I'm in Europe and the guys at the phone can't help me, i'm kinda screwed, jaj.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,660
4,200
Err, what!?
Last time, it took 2 weeks review time (took about 4 days to actually go into review). And then after 2 weeks I got rejected because they "suspected" I was stealing 3rd party things, while I had all the rights to myself.
So I resubmitted while using some copyright logo's, then took only 2 days for going into review, and after a week, they did another reject for same reason.. Was pulling my hairs.. but since I'm in Europe and the guys at the phone can't help me, i'm kinda screwed, jaj.
Wow.

That sucks.

They rejected me once for having a banner prompting the user to upgrade to premium that looked exactly like an iAd (the banner would appear while the iAd request was being processed, the idea was to make the transition from my ad to an iAd be a smooth one... alas, I changed the banner to be solid gold instead.)

Edit: It seems that if your app is going to be approved, it will be approved within a few hours of going into review. If it's not going to be approved, it's going to be in review for several days. So once it's been more than 4 hours or so, you can count on your app having been rejected and them just making you wait for them to write up an official report with a reason.
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
450
The Centennial State
Err, what!?
As I said, that's been my experience. YMMV.

And I guess I was exaggerating a bit with "less than an hour". But certainly within a few hours.

In case you're curious, here's how the last few versions of Quippa went:
Waiting For Review:11/11 12:27PM, In Review: 11/17 1:28PM, Processing for App Store: 11/17 4:27PM
Waiting For Review:11/21 4:40PM, In Review: 11/28 11:54AM, Processing for App Store: 11/28 12:32PM
Waiting For Review:01/05 5:36PM, In Review: 01/11 10:06AM, Processing for App Store: 01/11 3:09PM
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
As I said, that's been my experience. YMMV.

And I guess I was exaggerating a bit with "less than an hour". But certainly within a few hours.

In case you're curious, here's how the last few versions of Quippa went:
Waiting For Review:11/11 12:27PM, In Review: 11/17 1:28PM, Processing for App Store: 11/17 4:27PM
Waiting For Review:11/21 4:40PM, In Review: 11/28 11:54AM, Processing for App Store: 11/28 12:32PM
Waiting For Review:01/05 5:36PM, In Review: 01/11 10:06AM, Processing for App Store: 01/11 3:09PM
I know it was your experience, it just seems a bit unfair sometimes.
My friend got it into review/accepted within 3 days. And I know some people who got stuck for 3 weeks, I don't know the logic they are following, but I'm wondering why I keep sticking around :p
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.