baker icon indicating copy to clipboard operation
baker copied to clipboard

App crash in offline mode

Open aspek opened this issue 13 years ago • 11 comments

Hi, I'm testing Baker with latest version (download on 13 feb 2013 ). And I found problem on my iPad.

  1. I running the app it work fine. And Did not do anything. ( I have already .json file on sever)
  2. Tap home button to home screen.
  3. Turn off the wifi.
  4. Kill app in background.
  5. Open it again. App would crash.
  6. Try to do point 5 again. App still crash
  7. But if I turn on wifi. Try to do point 5 again. App can run smooth again.

aspek avatar Feb 15 '13 08:02 aspek

We have to check that, thanks for the feedback.

  1. Does the issue appear also on version 4.0?
  2. Could you please past the debug log?

folletto avatar Feb 15 '13 11:02 folletto

Ops, I miss something. Edit comment 1 change point 6-7.

Answer. 1.YES 2.Wait a moment please.

aspek avatar Feb 15 '13 11:02 aspek

Here is my debug log...

Feb 26 19:50:33 2fellows-IPAD4 Baker[5757] : ====== Newsstand is enabled ====== ��Feb 26 19:50:33 2fellows-IPAD4 kernel[0] : launchd[5757] Builtin profile: container (sandbox) ��Feb 26 19:50:33 2fellows-IPAD4 kernel[0] : launchd[5757] Container: /private/var/mobile/Applications/590A47A8-59A6-4398-92B9-FECF0EF2F99E (sandbox) ��Feb 26 19:50:33 2fellows-IPAD4 networkd[71] : client_connection_cellular_start no interface match ��Feb 26 19:50:33 2fellows-IPAD4 networkd[71] : client_connection_cellular_start no interface match ��Feb 26 19:50:33 2fellows-IPAD4 Baker[5757] : Error loading Shelf manifest: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo=0x1c58c2d0 {NSErrorFailingURLStringKey=http://jsonfile, NSErrorFailingURLKey=http://jjsonfile, NSLocalizedDescription=The Internet connection appears to be offline., NSUnderlyingError=0x1c58a890 "The Internet connection appears to be offline."} ��Feb 26 19:50:33 2fellows-IPAD4 Baker[5757] : Loading cached Shelf manifest from /var/mobile/Applications/590A47A8-59A6-4398-92B9-FECF0EF2F99E/Library/Caches/shelf.json ��Feb 26 19:50:33 2fellows-IPAD4 Baker[5757] : Refreshing HIPissue4 view with status (null) -> remote ��Feb 26 19:50:33 2fellows-IPAD4 Baker[5757] : Refreshing HIPissue3 view with status (null) -> remote ��Feb 26 19:50:33 2fellows-IPAD4 Baker[5757] : Refreshing HIPissue2 view with status (null) -> downloaded ��Feb 26 19:50:33 2fellows-IPAD4 Baker[5757] : Refreshing HIPissue1 view with status (null) -> remote ��Feb 26 19:50:33 2fellows-IPAD4 networkd[71] : client_connection_cellular_start no interface match ��Feb 26 19:50:33 2fellows-IPAD4 networkd[71] : client_connection_cellular_start no interface match ��Feb 26 19:50:33 2fellows-IPAD4 Baker[5757] : App Store request failure: (null) ��Feb 26 19:50:33 2fellows-IPAD4 Baker[5757] : * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' *** First throw call stack: (0x328ae3e7 0x3a73e963 0x327ff87b 0x327ff737 0x96be7 0x3466f197 0x3ab58793 0x3ab585db 0x3ab5be45 0x328821b1 0x327f523d 0x327f50c9 0x363af33b 0x347112b9 0x395bb 0x39548) ��Feb 26 19:50:33 2fellows-IPAD4 backboardd[26] : CoreAnimation: updates deferred for too long ��Feb 26 19:50:33 2fellows-IPAD4 ReportCrash[5758] : Formulating crash report for process Baker[5757] ��Feb 26 19:50:33 2fellows-IPAD4 com.apple.launchd1 : (UIKitApplication:com.yourcompany.Baker[0xdb2c]) Job appears to have crashed: Abort trap: 6 ��Feb 26 19:50:33 2fellows-IPAD4 backboardd[26] : Application 'UIKitApplication:com.yourcompany.Baker[0xdb2c]' exited abnormally with signal 6: Abort trap: 6 Feb 26 19:50:33 2fellows-IPAD4 ReportCrash[5758] : libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary Feb 26 19:50:33 2fellows-IPAD4 ReportCrash[5758] : Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Baker_2013-02-26-195033_2fellows-IPAD4.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0

I sensors my json path it is private

aspek avatar Feb 15 '13 12:02 aspek

I focus the point of problem.

This error ONLY occur after the program downloaded an issue. sorry in comment 1 is not clear

And do this loop. -Tap home button to home screen. -Turn off the wifi. -Kill app in background. -Open it again. App would crash. -Try to do point 5 again. App still crash -But if I turn on wifi. Try to do point 5 again. App can run smooth again.

aspek avatar Feb 15 '13 12:02 aspek

Thanks! :)

folletto avatar Feb 15 '13 14:02 folletto

OK. I found the true problem. I would like to forget in a top comment.

If you fix the subscription such as "com.companyname.baker.Free" and turn off wifi. And running App on iPad. Then the app will crash. But in simulator work fine.

Alert call this line. in PurchasesManager.m

  • (void)request:(SKRequest *)request didFailWithError:(NSError *)error { NSLog(@"App Store request failure: %@", error); NSDictionary *userInfo = [NSDictionary dictionaryWithObject:error forKey:@"error"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"notification_products_request_failed" object:self userInfo:userInfo];

    [request release];

}

I added conditions.

  • (void)request:(SKRequest *)request didFailWithError:(NSError *)error { NSLog(@"App Store request failure: %@", error);

    if(error) { NSDictionary *userInfo = [NSDictionary dictionaryWithObject:error forKey:@"error"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"notification_products_request_failed" object:self userInfo:userInfo]; }

    [request release];

}

I do not know what is the best way? But the problem has been solved.

aspek avatar Feb 15 '13 18:02 aspek

I did a bit of testing. If you have configured In-App Purchases and there's no connection, you will get a couple of alerts saying "Failure connecting to the App Store". This is annoying and so I've fixed it in e913b8cbcd9944ebf906dca93c32ef86d6208f6d, but in all my tests I could not get the app to crash.

Can you test again with the latest master?

Simbul avatar Feb 18 '13 23:02 Simbul

OK, It works perfectly. Thank!!

But I think about alerts internet problem.It call specifically when run App on simulator. If run app to iPad. The first thing to do get ".json" for show on shelf(It have caches now). And turn off wifi , Kill App in background, Open it again , And no any further notification. The truth to be notified every time or not? When open the app ( without an app running in background ). Or alerts after being active some button when no internet connection. This is just my opinion. And very sorry in my english.

aspek avatar Feb 19 '13 06:02 aspek

I'm sorry, I can't quite understand. I'll try to rephrase.

If you open the app for the first time and there's no internet connection, you will get an alert. If you open the app after having cached the shelf JSON and there's no internet connection, the cache will be used and you will not get an alert.

The cached shelf JSON should persist even if you kill the app.

Is that the behaviour you're experiencing? What exactly is your issue with alerts?

Simbul avatar Mar 05 '13 00:03 Simbul

You understand it correctly. I think the "App" must be notified if User tap down on download button. Because,In offline mode the latest version of "baker" not show alert when user active the button it get stuck to waiting for progress . But I configure this at #714.

aspek avatar Mar 05 '13 09:03 aspek

Closing as the issue is now fixed. Will track your suggestion in the issue you opened.

Simbul avatar Mar 11 '13 22:03 Simbul