배경
- Gradle 8로 업데이트하고 FirebaseInstallationServiceClient 관련해서 Crashlytics에 급격하게 리포트가 되기 시작했다.
로그
- 재현은 되지 않아서 Crashlytics 로그에만 의존했다.
Fatal Exception: java.lang.AbstractMethodError: abstract method "H.c H.c.G(int)"
at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.readGenerateAuthTokenResponse(FirebaseInstallationServiceClient.java:90)
at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.b(FirebaseInstallationServiceClient.java:94)
at com.google.firebase.installations.FirebaseInstallations.fetchAuthTokenFromServer(FirebaseInstallations.java:31)
at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:66)
at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$3(FirebaseInstallations.java:66)
at com.google.firebase.concurrent.SequentialExecutor$1.run(SequentialExecutor.java:9)
at com.google.firebase.concurrent.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:1)
at com.google.firebase.concurrent.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:13)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:13)
at com.google.firebase.concurrent.CustomThreadFactory$$ExternalSyntheticLambda0.run(R8$$SyntheticClass:15)
at java.lang.Thread.run(Thread.java:1012)
원인
- Gradle 8 버전으로 업데이트되면서, FirebaseInstallationServiceClient 코드에 난독화가 되어 메서드를 찾지 못했다.
- Gradle 8버전으로 올리게 되면, 기본적으로 fullMode가 활성화된다.
- 간단하게 이야기하자면, 난독화를 좀 더 적극적으로 진행한다고 이해하면 된다.
- 이로 인해, 기존에는 난독화가 되지 않았던 부분들이 난독화되는 경우가 발생한다.
대책
- proguard rule에 FirebaseInstallationServiceClient와 관련된 코드들을 추가했다.
-keep class com.google.firebase.installations.** { *; }
-keep interface com.google.firebase.installations.** { *; }
참고