ios - App Rejected - Crashes on Launch unable to replicate -
i have app works when test on device, after submitting apple review, told app crashes @ launch. further investigation of symbolicated crash log showed there wrong below function (line 131: self.highscore = leaderboardrequest.localplayerscore.value)
anyone see before? i'm thinking has 64bit architecture can't replicate error.
func gethighscore(leaderboardid: string) { let localplayerid = gklocalplayer.localplayer().playerid let leaderboardrequest = gkleaderboard(playerids: [localplayerid]) gkleaderboard! leaderboardrequest.identifier = leaderboardid if leaderboardrequest != nil { leaderboardrequest.loadscoreswithcompletionhandler({ (scores:[anyobject]!, error:nserror!) -> void in if error != nil { //handle error log.debug("error retrieving score") } else { log.debug("here go: \(leaderboardrequest.localplayerscore.value)") self.highscore = leaderboardrequest.localplayerscore.value //line 131 nsnotificationcenter.defaultcenter().postnotificationname(authenticated_notification, object: self) } }) } }
crash logs below:
{"app_name":"mygameapp","app_version":"1.1","bundleid":"com.aaapps.mygameapp","adam_id":933686335,"os_version":"iphone os 8.1.1 (12b435)","slice_uuid":"00f078c2-cb60-3dec-b4d5-27187cb55a13","share_with_app_devs":false,"build_version":"1","is_first_party":false,"bug_type":"109","name":"mygameapp"} incident identifier: 5010ef12-a30a-41e2-9fea-2335c25eb3dc crashreporter key: e3d10d2ccd5af0e83a5e75453e737ab344eca9e4 hardware model: xxx process: mygameapp [2917] path: /private/var/mobile/containers/bundle/application/d3bd0802-4f20-4c10-ac6a-e0eacecfee44/mygameapp.app/mygameapp identifier: com.aaapps.mygameapp version: 1 (1.1) code type: arm-64 (native) parent process: launchd [1] date/time: 2014-12-01 09:56:07.167 -0800 launch time: 2014-12-01 09:56:01.608 -0800 os version: ios 8.1.1 (12b435) report version: 105 exception type: exc_breakpoint (sigtrap) exception codes: 0x0000000000000001, 0x00000001002682e0 triggered thread: 0 thread 0 name: dispatch queue: com.apple.main-thread thread 0 crashed: 0 libswiftcore.dylib 0x00000001002682e0 _tfss18_fatalerrormessageftvss12staticstrings_s_su_t_ + 144 1 libswiftcore.dylib 0x00000001002682dc _tfss18_fatalerrormessageftvss12staticstrings_s_su_t_ + 140 **2 mygameapp 0x00000001000f8c48 mygameapp.gamekithelper.(gethighscore (mygameapp.gamekithelper) -> (swift.string) -> ()).(closure #1) (gamekithelper.swift:131)** 3 mygameapp 0x00000001000f9060 reabstraction thunk helper @callee_owned (@owned [swift.anyobject]!, @owned objectivec.nserror!) -> (@unowned ()) @callee_owned (@in ([swift.anyobject]!, objectivec.nserror!)) -> (@out ()) (gamekithelper.swift:123) 4 mygameapp 0x00000001000f3188 partial apply forwarder reabstraction thunk helper @callee_owned (@owned [swift.anyobject]!, @owned objectivec.nserror!) -> (@unowned ()) @callee_owned (@in ([swift.anyobject]!, objectivec.nserror!)) -> (@out ()) (gamekithelper.swift:0) 5 mygameapp 0x00000001000f9088 reabstraction thunk helper @callee_owned (@in ([swift.anyobject]!, objectivec.nserror!)) -> (@out ()) @callee_owned (@owned [swift.anyobject]!, @owned objectivec.nserror!) -> (@unowned ()) (gamekithelper.swift:0) 6 mygameapp 0x00000001000f91f8 reabstraction thunk helper @callee_owned (@owned [swift.anyobject]!, @owned objectivec.nserror!) -> (@unowned ()) @callee_unowned @objc_block (@unowned objectivec.nsarray!, @unowned objectivec.nserror!) -> (@unowned ()) (gamekithelper.swift:123) 7 gamecenterfoundation 0x000000018d45e3c0 __39-[gkdispatchgroup
if (error != nil) { println("error: \(error!.localizeddescription)") }else if (scores != nil) { let localplayerscore = leaderboardrequest.localplayerscore println("local player's score: \(localplayerscore.value)") }
you must add
if (scores != nil)
because scores array nil ( have no scores before submit one) leaderboardrequest.localplayerscore.value nil , crash
barn
Comments
Post a Comment