Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Android simple push notification app crashes inmediatdlly on release build


This question is answered.


Permlink Replies: 5 - Last Post: May 17, 2016 7:45 AM Last Post By: SEnnis Ennis
Luis Concepcion

Posts: 16
Registered: 3/16/00
Android simple push notification app crashes inmediatdlly on release build  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 22, 2015 12:03 PM
Hi

Using Seattle, and following the docwiki tutorial, I created an Android mobile app which receives push notifications using Parse.com

If I build the debug versión, it works fine and receives the notifications, but in the release versión, app closes inmediatelly.

Entitlements, permissions, template file, etc are exactly the same.

What is wrong?

Edited by: Luis Concepcion on Oct 23, 2015 1:24 AM
Luis Concepcion

Posts: 16
Registered: 3/16/00
Re: Android simple push notification app crashes inmediatdlly on release build  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2015 2:40 AM   in response to: Luis Concepcion in response to: Luis Concepcion
I have been trying different things and I noticed the following:

1) If I drop a KinveyProvider component, instead of a ParseProvider, and set PushEvents.Provider to it, the app crashes too.
2) If I unset the PushEvents.Provider (leave it blank), the apps runs (no crash), so the problema is with PushEvents component.
3) As I said, the Debug version runs and Works fine.
4) In Release version, Project->Options->Compiling, If I set "Use Debug .dcus", the app runs correctly!!!!

I have checked the Deployment files, entitlements, permissions, Template XML, etc. and are identical!

Is there a bug with the reléase versión? Why with debug .dcu files it Works fine?!?


Luis Concepcion wrote:
Hi

Using Seattle, and following the docwiki tutorial, I created an Android mobile app which receives push notifications using Parse.com

If I build the debug versión, it works fine and receives the notifications, but in the release versión, app closes inmediatelly.

Entitlements, permissions, template file, etc are exactly the same.

What is wrong?

Edited by: Luis Concepcion on Oct 23, 2015 1:24 AM
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Android simple push notification app crashes inmediatdlly on release build
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2015 11:45 AM   in response to: Luis Concepcion in response to: Luis Concepcion
Try setting the PushEvents provider at runtime in a 3 second timer.

It's possible Debug runs slower (which it does) which may cause events to execute sooner or later than in Release.
Luis Concepcion

Posts: 16
Registered: 3/16/00
Re: Android simple push notification app crashes inmediatdlly on release build  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 2:05 AM   in response to: Eli M in response to: Eli M
That worked!

Thanks!

Eli M wrote:
Try setting the PushEvents provider at runtime in a 3 second timer.

It's possible Debug runs slower (which it does) which may cause events to execute sooner or later than in Release.
SEnnis Ennis

Posts: 5
Registered: 2/12/15
Re: Android simple push notification app crashes inmediatdlly on release build  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 13, 2016 11:45 AM   in response to: Luis Concepcion in response to: Luis Concepcion
Can someone give me a clue on how to set it later on. I've got the timer working, but it doesn't seem to stick.

Am I setting the provider property correctly?
PushEvents1.Provider := KinveyProvider1;


Later on when PushEvents1 runs CheckAPI, Provider appears to me to be 'nil'.

Luis Concepcion wrote:
That worked!

Thanks!

Eli M wrote:
Try setting the PushEvents provider at runtime in a 3 second timer.

It's possible Debug runs slower (which it does) which may cause events to execute sooner or later than in Release.
SEnnis Ennis

Posts: 5
Registered: 2/12/15
Re: Android simple push notification app crashes inmediatdlly on release build  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 17, 2016 7:45 AM   in response to: SEnnis Ennis in response to: SEnnis Ennis
For the sake of the next person:

1) To answer my own question: Yes. That's assigning a reference to the TKinveyProvider to the TPushEvents.Provider property.

2) I've also learned if you close your project and re-open it, the TPushEvents component re-finds the TKinveyProvider and then sets the TPushEvents.Provider - putting you right back in the same situation of crashing immediately. THANKS for being so "helpful" RAD Studio. I've tried blocking this with the TParseProvider and TEMSProvider, but of course that still causes it to crash as well. The way I got around it was to move the TPushEvents component into the private declarations for the form's class, and then instantiate it in the FormCreate. As an added benefit, you no longer need the timer. I'm assuming that's because the TKinveyProvider has finished whatever it needs to do by then.

SEnnis Ennis wrote:
Can someone give me a clue on how to set it later on. I've got the timer working, but it doesn't seem to stick.

Am I setting the provider property correctly?
PushEvents1.Provider := KinveyProvider1;


Later on when PushEvents1 runs CheckAPI, Provider appears to me to be 'nil'.

Luis Concepcion wrote:
That worked!

Thanks!

Eli M wrote:
Try setting the PushEvents provider at runtime in a 3 second timer.

It's possible Debug runs slower (which it does) which may cause events to execute sooner or later than in Release.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02