rhomobile / rhodes

The Rhodes framework is a platform for building locally executing, device-optimized mobile applications for all major smartphone devices.
http://tau-platform.com/
MIT License
1.05k stars 237 forks source link

Android 10: app freezes after minimize and maximize or toggling between apps #1029

Closed leonardofalk closed 4 years ago

leonardofalk commented 4 years ago

So far this happened in 2 devices that received Android 10 upgrade:

Rhodes: 7.1.0

ANR:


"main" prio=5 tid=1 Native
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x718d0438 self=0x7433bd1000
  | sysTid=2594 nice=0 cgrp=default sched=0/0 handle=0x743513dee8
  | state=S schedstat=( 6761545117 1314943790 18407 ) utm=515 stm=160 core=0 HZ=100
  | stack=0x7ff0b71000-0x7ff0b73000 stackSize=8192KB
  | held mutexes=
  #00  pc 00000000000ceff8  /apex/com.android.runtime/lib64/bionic/libc.so (__pselect6+8)
  #01  pc 000000000008e06c  /apex/com.android.runtime/lib64/bionic/libc.so (select+100)
  #02  pc 0000000000134108  /data/app/com.wonder_sistemas.probusm2--YgpLsq53rH4aASeYyJGqg==/lib/arm64/librhodes.so (select+276)
  at com.rhomobile.rhodes.RhodesService.callActivationCallback (Native method)
  at com.rhomobile.rhodes.RhodesService.handleAppDeactivation (RhodesService.java:1508)
  at com.rhomobile.rhodes.BaseActivity.activityStopped (BaseActivity.java:186)
  at com.rhomobile.rhodes.BaseActivity.onActivityStopped (BaseActivity.java:161)
  at com.rhomobile.rhodes.BaseActivity.onStop (BaseActivity.java:272)
  at com.rhomobile.rhodes.RhodesActivity.onStop (RhodesActivity.java:510)
  at android.app.Instrumentation.callActivityOnStop (Instrumentation.java:1474)
  at android.app.Activity.performStop (Activity.java:8213)
  at android.app.ActivityThread.callActivityOnStop (ActivityThread.java:4853)
  at android.app.ActivityThread.handleSleeping (ActivityThread.java:4990)
  at android.app.ActivityThread.access$2600 (ActivityThread.java:267)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2079)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at android.os.Looper.loop (Looper.java:237)
  at android.app.ActivityThread.main (ActivityThread.java:7777)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1047)
dmitrys commented 4 years ago

Hi, can you please test this rhodes gem for rebuild your application and retest case ? https://s3.amazonaws.com/files.tau-technologies.com/tmp/github_issue_1029/rhodes-7.1.0.gem Also you can use sources of rhodes from branch : https://github.com/rhomobile/rhodes/tree/github_issue_1029

leonardofalk commented 4 years ago

Hello, now it also breaks Android 9 with error:

Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{801e254 u0 com.wonder_sistemas.probusm2/com.rhomobile.rhodes.RhodesService}

  #00  pc 000000000007aad0  /system/lib64/libc.so (__epoll_pwait+8)
  #01  pc 0000000000014f04  /system/lib64/libutils.so (android::Looper::pollInner(int)+304)
  #02  pc 0000000000014d38  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+60)
  #03  pc 0000000000133430  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:332)
  at android.os.Looper.loop (Looper.java:168)
  at android.app.ActivityThread.main (ActivityThread.java:6878)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:547)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:876)

Still needs to be tested on Android 10.

leonardofalk commented 4 years ago

Same error confirmed on Android 10, using commit 3fdf49924a34f55d511909c927249aad4b85c793

dmitrys commented 4 years ago

We will prepare update soon

dmitrys commented 4 years ago

Hi,

Please try this gem - https://s3.amazonaws.com/files.tau-technologies.com/tmp/github_issue_1029/ver2/rhodes-7.1.0.gem or use sources from branch - https://github.com/rhomobile/rhodes/tree/github_issue_1029

leonardofalk commented 4 years ago

It misses android uses-permission FOREGROUND_SERVICE. After I've manually added the permission it runs, but a permanent app icon stays on the status bar with no information.

Despite that It runs fine on my phone, still needs test on other devices.

dmitrys commented 4 years ago

I do not known how run foreground service without icon. :-( We will discuss about it - may be add something to icon's panel etc. So, the main information - application work fine with our changes related foreground service. It is correct ?

leonardofalk commented 4 years ago

I did some reading and it looks that it's impossible to hide the icon, for security reasons. Maybe you can add a message telling it's running on the background. Well, not yet, I've tested on a single device (Android 9) because you introduced changes to backward versions. It still needs some testing on Android 10 devices.

alex-epifanoff commented 4 years ago

We're looking for ways how we can resolve that, I guess we'll have some working build in May.

alex-epifanoff commented 4 years ago

Fixed in 7.2.2