Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
cadrickloh
Posts: 14
Registered: ‎11-28-2013
My Device: BlackBerry Z30
Accepted Solution

Crash whenever it found nothing to restore!

[ Edited ]

I'm working in Native Core development and I'm facing this issue which is whenever I call the restore function, it will crash if the user doesn't purchase anything before. (I'm not testing it on local nor sandbox version, it's a LIVE version!)

 

I'm testing on BlackBerryZ10 OS version 10.2

Momentics version is

Version: 2.0

Build id: v201310251603

 

unsigned request_id = 0;

if (paymentservice_get_existing_purchases_request(true, Global::m_mainWnd->getWindowGroupId(), &request_id) != BPS_SUCCESS)

{

        fprintf(stderr, "Error: restore failed.\n");

}

 

Please help seriously need help! This is urgent

 

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Crash whenever it found nothing to restore!

What debugging have you done so far?

Are you saying this didn't happen for sandbox testing?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
New Developer
cadrickloh
Posts: 14
Registered: ‎11-28-2013
My Device: BlackBerry Z30

Re: Crash whenever it found nothing to restore!

It does happen in Sandbox mode. I have no idea how should I debug it. Is there anything like Android's LogCat where I can see the log files of the device? Sorry Im new in BB world
Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Crash whenever it found nothing to restore!

There's the standard debug logging on BB10 as well, take a look here...

 

http://developer.blackberry.com/native/documentation/cascades/getting_started/tools/debugging.html

 

There's also a good discussion on how to debug a release build here...

 

http://supportforums.blackberry.com/t5/Native-Development/Best-Recommended-way-to-log-information-in...


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
New Developer
cadrickloh
Posts: 14
Registered: ‎11-28-2013
My Device: BlackBerry Z30

Re: Crash whenever it found nothing to restore!

the standard debug doesn't work for me as I'm testing it on release build.

 

Another option which I think might not suit me as well because my problem is..

the app just crash and it doesnt crash because of certain line of codes..

 

that's the hardest part for me to debug...

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Crash whenever it found nothing to restore!

Right but the second link was about logging for a release build?

 

Sorry, but your line about not crashing because of certain lines of code made me laugh, one of your lines is making it crash that's for 99.9% sure. :-)

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
New Developer
cadrickloh
Posts: 14
Registered: ‎11-28-2013
My Device: BlackBerry Z30

Re: Crash whenever it found nothing to restore!

Yea you are right, is own my careless mistake, one of my value is NULL which causes the crash.

Please use plain text.
Developer
TobyKaos
Posts: 77
Registered: ‎12-12-2012
My Device: playbook

Re: Crash whenever it found nothing to restore!

Can you explain how you fix it because I am facing the same issue. I have think of a static var that I will call in a bad scoape or something else.

Please use plain text.
Developer
TobyKaos
Posts: 77
Registered: ‎12-12-2012
My Device: playbook

Re: Crash whenever it found nothing to restore!

Nobody have the same issue. Is it very disapointing because this occured only when no transaction have been made. If an item have been purchase then the get existing purchase function does not crash.

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Crash whenever it found nothing to restore!

@TobyKaos rather than adding to an old solved thread start your own one and PM the OP.

You might get a better response that way.

If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.