ikemura23 / Yaimafuni-Android

やいまふに Android
3 stars 0 forks source link

本番アプリが起動直後にエラーで落ちる #120

Closed ikemura23 closed 1 year ago

ikemura23 commented 1 year ago

100%発生する

debugビルドでは起きない releaseビルドでのみ起きる

原因はisMinifyEnabled=trueだと思うが、具体的にどこで落ちてる?

ikemura23 commented 1 year ago

debugビルドでisMinifyEnableをtrueにして再現させたエラーログ TopStatusRepositoryImplで発生してる?

com...a.yaeyama.liner.checker.debug  E  com.google.firebase.database.DatabaseException: Not a direct subclass of GenericTypeIndicator: class com.google.firebase.database.GenericTypeIndicator
    at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.convertToCustomClass(CustomClassMapper.java:104)
    at com.google.firebase.database.DataSnapshot.getValue(DataSnapshot.java:228)
    at com.yaeyama.linerchecker.repository.TopStatusRepositoryImpl$fetchTopStatuses$$inlined$map$1$2.emit(Emitters.kt:59)
    at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:37)
    at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl$FlowKt__ChannelsKt(Channels.kt:1)
    at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Channels.kt:0)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:254)
    at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:189)
    at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:161)
    at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:474)
    at kotlinx.coroutines.CancellableContinuationImpl.completeResume(CancellableContinuationImpl.kt:590)
    at kotlinx.coroutines.channels.BufferedChannelKt.tryResume0(BufferedChannel.kt:2896)
    at kotlinx.coroutines.channels.BufferedChannelKt.access$tryResume0(BufferedChannel.kt:1)
    at kotlinx.coroutines.channels.BufferedChannel$BufferedChannelIterator.tryResumeHasNext(BufferedChannel.kt:1689)
    at kotlinx.coroutines.channels.BufferedChannel.tryResumeReceiver(BufferedChannel.kt:642)
    at kotlinx.coroutines.channels.BufferedChannel.updateCellSend(BufferedChannel.kt:458)
    at kotlinx.coroutines.channels.BufferedChannel.access$updateCellSend(BufferedChannel.kt:36)
    at kotlinx.coroutines.channels.BufferedChannel.trySend-JP2dKIU(BufferedChannel.kt:304)
    at kotlinx.coroutines.channels.ChannelCoroutine.trySend-JP2dKIU(ChannelCoroutine.kt:0)
    at com.yaeyama.linerchecker.ext.FirebaseExtKt$valueEvents$1$listener$1.onDataChange(FirebaseExt.kt:20)
    at com.google.firebase.database.core.ValueEventRegistration.fireEvent(ValueEventRegistration.java:75)
    at com.google.firebase.database.core.view.DataEvent.fire(DataEvent.java:63)
    at com.google.firebase.database.core.view.EventRaiser$1.run(EventRaiser.java:55)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7872)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
ikemura23 commented 1 year ago

方法1 ProGuardファイルに無視する設定をかく https://firebase.google.com/docs/database/android/start?hl=ja#proguard

方法2 クラスに@Keepをつける? https://developer.android.com/studio/write/annotations?hl=ja#adding-annotations

ikemura23 commented 1 year ago

GenericTypeIndicatorのドキュメント https://firebase.google.com/docs/reference/kotlin/com/google/firebase/database/GenericTypeIndicator

ikemura23 commented 1 year ago

対応済み