flutter_cube icon indicating copy to clipboard operation
flutter_cube copied to clipboard

Ruby example is not responding on Android

Open tomk9 opened this issue 6 years ago • 3 comments

Application ruby is launching and the app bar is visible but the body is empty. After a few seconds, the application is closing. Example cube_app works perfectly. Logcat:

2019-12-26 20:39:00.674 764-1631/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.ruby/.MainActivity bnds=[35,1344][237,1633]} from uid 10063 on display 0
2019-12-26 20:39:00.768 764-9223/? I/ActivityManager: Start proc 14946:com.example.ruby/u0a110 for activity com.example.ruby/.MainActivity
2019-12-26 20:39:00.935 14946-14946/? I/om.example.ruby: type=1400 audit(0.0:834): avc: denied { open } for path="/dev/mali0" dev="tmpfs" ino=8197 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1
2019-12-26 20:39:00.935 14946-14946/? I/om.example.ruby: type=1400 audit(0.0:835): avc: denied { getattr } for path="/dev/mali0" dev="tmpfs" ino=8197 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1
2019-12-26 20:39:01.766 14946-14990/com.example.ruby I/[MALI][Gralloc]: [+]r_hnd(0x7f7747b720), client(72), share_fd(73)
2019-12-26 20:39:01.773 14946-14990/com.example.ruby I/[MALI][Gralloc]: [+]r_hnd(0x7f7747b860), client(72), share_fd(76)
2019-12-26 20:39:01.782 764-784/? I/ActivityManager: Displayed com.example.ruby/.MainActivity: +1s61ms
2019-12-26 20:39:01.789 14946-14990/com.example.ruby I/[MALI][Gralloc]: [+]r_hnd(0x7f7747c260), client(72), share_fd(79)
2019-12-26 20:39:04.110 14946-14965/com.example.ruby I/[MALI][Gralloc]: [+]r_hnd(0x7f563f7820), client(72), share_fd(75)
2019-12-26 20:39:04.140 764-9189/? I/ActivityManager: Fully drawn com.example.ruby/.MainActivity: +3s419ms
2019-12-26 20:39:16.339 764-9224/? I/ActivityManager: Process com.example.ruby (pid 14946) has died
2019-12-26 20:39:16.341 764-9222/? I/WindowManager: WIN DEATH: Window{1fd8e54 u0 com.example.ruby/com.example.ruby.MainActivity}
2019-12-26 20:39:16.350 764-9224/? W/ActivityManager: Force removing ActivityRecord{acfaf8e u0 com.example.ruby/.MainActivity t2206}: app died, no saved state
2019-12-26 20:39:16.367 764-9222/? W/WindowManager: Force-removing child win Window{5a1fef2 u0 SurfaceView - com.example.ruby/com.example.ruby.MainActivity} from container Window{1fd8e54 u0 com.example.ruby/com.example.ruby.MainActivity}

tomk9 avatar Dec 26 '19 20:12 tomk9

On weak devices app ruby crashes. On iPhone 5S error is:

Can't get most elevated app state from dictionary {
    BKSApplicationStateExtensionKey = 0;
    SBApplicationStateDisplayIDKey = "com.example.ruby";
    SBApplicationStateKey = 0;
    SBApplicationStateProcessIDKey = 1274;
    SBApplicationStateRunningReasonsKey =     (
                {
            SBApplicationStateRunningReasonAssertionIdentifierKey = Resume;
            SBApplicationStateRunningReasonAssertionReasonKey = 10000;
        }
    );
}

On iPhone 11 works fine. Is it possible to do heavy calculation on different thread to not blocking main thread? Maybe this will help.

tomk9 avatar Jan 15 '20 12:01 tomk9

The ruby_rose.obj has too many vertices, and it will consume double memory when rendering, then the app crashes due to insufficient memory. I tried to do the calculation async and the result is still the same.

zesage avatar Jan 16 '20 10:01 zesage

I was suggested an error from Logcat, saying that the application window does not respond. In the out of memory should be another error in Logcat. Did you try to do calculations in background isolate using compute? https://api.flutter.dev/flutter/foundation/compute.html

tomk9 avatar Jan 16 '20 17:01 tomk9