Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

[Devel Bug] ClassCastException when running in emulator without Play Store #1531

Closed
ctsk opened this issue Nov 14, 2022 · 0 comments · Fixed by #1564
Closed

[Devel Bug] ClassCastException when running in emulator without Play Store #1531

ctsk opened this issue Nov 14, 2022 · 0 comments · Fixed by #1564
Labels

Comments

@ctsk
Copy link
Contributor

ctsk commented Nov 14, 2022

When the app is running in the emulator where the play store isn't available, the app crashes when requesting a review. The stack trace reveals these lines as the culprit:

} else {
// There was some problem, log or handle the error code.
@ReviewErrorCode val reviewErrorCode = (task.exception as ReviewException).errorCode
}

Stack trace:

Process: de.tum.in.tumcampus, PID: 19000
    java.lang.ClassCastException: com.google.android.play.core.internal.zzat cannot be cast to com.google.android.play.core.review.ReviewException
        at de.tum.in.tumcampusapp.component.ui.overview.MainFragment.triggerReviewPrompt$lambda-2(MainFragment.kt:190)
        at de.tum.in.tumcampusapp.component.ui.overview.MainFragment.$r8$lambda$m8fOp0j6HyX2ulP4M4cVAfmKVBg(Unknown Source:0)
        at de.tum.in.tumcampusapp.component.ui.overview.MainFragment$$ExternalSyntheticLambda0.onComplete(Unknown Source:4)
        at com.google.android.play.core.tasks.zza.run(com.google.android.play:core@@1.10.3:1)
        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:7898)
        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)

Since the result of that cast isn't used, I suggest removing it. Objections?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
1 participant