CodenameOne icon indicating copy to clipboard operation
CodenameOne copied to clipboard

App crash when returning from background if Dialog permission was showing in android side

Open DurankGts opened this issue 4 years ago • 14 comments

if I request Dialog permission and next go to background and it return again the dialog is showed perfectly by if you repeat the same step again my app crash ang ANR is showed in android 10.

2021-09-16 16:52:16.837 1151-1151/? E/Layer: [Surface(name=AppWindowToken{3fb193 token=Token{ad5a682 ActivityRecord{28dadcd u0 com.geotracksolutionsint.forcesos/.ForceSOSStub t95737}}})/@0xd5f1df5 - animation-leash#0] No local sync point found

check this log in real device.

the methods star() , stop() doesn't fire if the Permission dialg is showed in fron of my app.

image

DurankGts avatar Sep 16 '21 20:09 DurankGts

@shannah this issue was solved with this committ? https://github.com/codenameone/CodenameOne/commit/09a9c130390fef21f35ff57d1ad4c69ad2e9753e

this committ is available today in this moment?

DurankGts avatar Sep 17 '21 12:09 DurankGts

@shai-almog please help me to check if this committ solved the issue in android side and if this committ is applied in the built server.

DurankGts avatar Sep 17 '21 16:09 DurankGts

Please check the video about the behavior of your stub in the android side. As I describe up. When I go to background with the native dialog permission in front of my app many times. The focus of my app goes to black and next crashed. I put some log in your generate code by built server and I check that you have a synchronized code that when my app fail it keep waiting. Could you tell me why ?(see the video)

image

issue background.zip

DurankGts avatar Sep 17 '21 22:09 DurankGts

I test in android 10 and 11. in 10 fail like the video and with the 11 don't fail at the moment

DurankGts avatar Sep 18 '21 00:09 DurankGts

Why some times if I have the native permission dialog in from of my app an I go to background. The method star() if fire instead of stop()?

DurankGts avatar Sep 20 '21 01:09 DurankGts

I fix the problem ignoring this event that you generate when may app goes to backgrond.

DurankGts avatar Sep 20 '21 03:09 DurankGts

I don't Know why you are sending this event if the app goes to backgrond

DurankGts avatar Sep 20 '21 03:09 DurankGts

@shannah that related with this committ https://github.com/DurankGts/CodenameOne/commit/16ae9b8f59f08f9700bb5177dd66309c5f03b429

?

DurankGts avatar Sep 21 '21 21:09 DurankGts

No. Not related

shannah avatar Sep 21 '21 21:09 shannah

do you check the video up about this issue?

DurankGts avatar Sep 21 '21 21:09 DurankGts

I fix the problem ignoring this event that you generate when may app goes to backgrond.

@DurankGts Could you please describe more specifically how you resolved it? Thank you.

plumberg avatar Oct 04 '21 14:10 plumberg

image

this the way that I found correctly. I don't know why the build generated code in this specific case it send and start event to my app when I go to background.

DurankGts avatar Oct 04 '21 14:10 DurankGts

@plumberg do you have the same issue?

DurankGts avatar Oct 04 '21 14:10 DurankGts

@DurankGts Yes, I noticed that in Android 11 everything works fine. But in Android 10 when you reopen it from a background the app just didn't load the form (at least it happened few times. Now it works). When I debugged the behavior in Android Studio, I noticed that when you put the app in the background, sometimes it calls only stop() method, sometimes start() and stop() methods simultaneously. I wasn't able to debug the case when the app just doesn't load the form yet.

plumberg avatar Oct 04 '21 14:10 plumberg