Coram Deo

[Flutter] 에러 해결 - E/AndroidRuntime(22637): DeadSystemException: The system died; earlier logs will point to the root cause 본문

에러 해결

[Flutter] 에러 해결 - E/AndroidRuntime(22637): DeadSystemException: The system died; earlier logs will point to the root cause

탁탁슝 2024. 6. 13. 23:18

- 문제 

플러터에서 안드로이드 애뮬레이터를 실행하려고 하는데 아래와 같은 오류가 났다

E/AndroidRuntime(22637): DeadSystemException: The system died; earlier logs will point to the root cause

 

- 해결

stack overflow에 검색해보니, 만약 A라는 프로세스를 제대로 종료하지 않고, B라는 프로세스를 실행했을 때 나타나는 문제라고 했다.

생각해보니 안드로이드 스튜디오에서 기본 Hello world 앱을 제대로 종료하지 않은 기억이 있었다.

그래서 애뮬레이터에 설치되어있던 Hello world 앱을 삭제해주고 다시 run and debug를 하니 제대로 실행되었다 !! 

https://stackoverflow.com/questions/42784731/android-deadsystemexception

 

Android DeadSystemException

Currently, we are experiencing a DeadSystemException in our HockeyApp crash reporting. It occurs on Android 7.0 and Android 7.1. We don't experience this exception in the previous version of our

stackoverflow.com

// 스택오버플로우 해결책
Fatal Exception: java.lang.RuntimeException: android.os.DeadSystemException
This exception was caused in one of the apps I was developing, it occurred mostly in MI devices.

After debugging I found that I was trying to start another service (Say B) in the current service (Say A) from a background thread, 
but when startService(itService) method was called the service A was already killed.

The only solution I found till now is to check if the current service A is running or not before you start another service B. 
Depending on your implementation you can use one of the various ways to check if a services is running from this answer.