개발(Android)/issues

[Android Studio] E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1 (2)

shinyelee 2022. 6. 22. 03:05

[안드로이드 스튜디오] 푸시 메시지 발송 시 앱이 강제 종료되는 오류

문제

 

[Android Studio] E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1 (1)

[안드로이드 스튜디오] 푸시 메시지 발송 시 앱이 강제 종료되는 오류 문제 해결 방법 (1) Invalidate Caches / Restart... 해결 방법 (2) Clean Project 및 Rebuild Project 해결 방법 (3) Android Virtual D..

shinye0213.tistory.com

Logcat에는 아무런 에러 메시지가 뜨지 않아 Debug를 해 봄
뭐가 문제인지 알아보자

E/MyLikeActivity: DataSnapshot { key = omfMOcZKwlMrxv2rAlkrcLC9fLn1, value = {qlLUy5dR38RCumYLMxOgbPn9ptp2=true} }
D/CompatibilityChangeReporter: Compat change id reported: 147798919; UID 10121; state: ENABLED
W/elee.dating_ap: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
    Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
W/elee.dating_ap: Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1
    Process: com.shinyelee.dating_app, PID: 6414
    java.lang.IllegalArgumentException: Unable to create call adapter for class java.lang.Object
        for method NotiAPI.postNotification
        at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:751)
        at retrofit2.ServiceMethod$Builder.createCallAdapter(ServiceMethod.java:236)
        at retrofit2.ServiceMethod$Builder.build(ServiceMethod.java:161)
        at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:169)
        at retrofit2.Retrofit$1.invoke(Retrofit.java:146)
        at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
        at $Proxy1.postNotification(Unknown Source)
        at com.shinyelee.dating_app.message.MyLikeActivity$testPush$1.invokeSuspend(MyLikeActivity.kt:136)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
     Caused by: java.lang.IllegalArgumentException: Could not locate call adapter for class java.lang.Object.
      Tried:
       * retrofit2.ExecutorCallAdapterFactory
        at retrofit2.Retrofit.nextCallAdapter(Retrofit.java:240)
        at retrofit2.Retrofit.callAdapter(Retrofit.java:204)
        at retrofit2.ServiceMethod$Builder.createCallAdapter(ServiceMethod.java:234)
        	... 12 more
V/FA: Recording user engagement, ms: 3188
I/Process: Sending signal. PID: 6414 SIG: 9
Disconnected from the target VM, address: 'localhost:9658', transport: 'socket'

해결 방법 (5) Retrofit과 Gson 버전 확인

build.gradle (Module: 프로젝트명.app)에서 Gson 버전을 Retrofit 버전에 맞춰줌
이제 클릭해도
최소한 튕기거나 강제 종료가 되지는 않으나
디버깅 과정에서 새로운 문제 발견

E/FirebaseMessaging: Topic sync or token retrieval failed on hard failure exceptions: java.util.concurrent.ExecutionException: java.io.IOException: SERVICE_NOT_AVAILABLE. Won't retry the operation.

해결 방법 (6) Cold Boot Now

기기를 재부팅하니 (5)의 에러 메시지는 사라짐


해결 방법 (7) AndroidManifest.xml 수정

캡처와 같이 수정


해결 방법 (8) Home time zone 변경

아예 컴퓨터를 재부팅하니 이런 에러가 뜸

2022-06-22 10:21:31.529 3831-3866/com.shinyelee.dating_app E/FirebaseMessaging: Topic sync or token retrieval failed on hard failure exceptions: java.util.concurrent.ExecutionException: java.io.IOException: SERVICE_NOT_AVAILABLE. Won't retry the operation.

Clock 앱에 들어가
Home time zone을 (GMT+9:00) Seoul로 설정
방법 1~8까지 시도하다보면 어느 순간 해결됨


참고

 

안드로이드 스튜디오 에뮬레이터 시간 설정하기

1. 안드로이드 스튜디오 에뮬레이터 내부 앱 중에 Clock을 찾아서 들어간다. 2. 더보기 (점 3개)를 누른다, 거기서 Setting 으로 들어간다. 3. Home time zone을 찾는다 4. 서울을 찾고 클릭한다. 시간 설정

learncom1234.tistory.com

반응형