Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception: java.lang.RuntimeException: Unable to start activity ShowkaseBrowserActivity #366

Closed
Monabr opened this issue Dec 17, 2023 · 12 comments

Comments

@Monabr
Copy link

Monabr commented Dec 17, 2023

Hello.

With each of my releases, bots come to me and launch ShowkaseBrowserActivity, it crashes and I get bad statistics. Is there any way to fix this?

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{.../com.airbnb.android.showkase.ui.ShowkaseBrowserActivity}: com.airbnb.android.showkase.exceptions.ShowkaseException: Missing key in bundle. Please start this activity by using the intent returned by the ShowkaseBrowserActivity.getIntent() method.
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
       at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7656)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
@vinaygaba
Copy link
Collaborator

Are you manually starting the activity? You are supposed to start this activity using the ShowkaseBrowserActivity.getIntent() method. Is that what you used?

@Monabr
Copy link
Author

Monabr commented Dec 23, 2023

@vinaygaba I am not using this activity, some bots launch it in my code. I am not manually starting the activity.

@vinaygaba
Copy link
Collaborator

@Monabr In that case, this activity isn't being started correctly as it needs more information to work correctly. This is an intentional failure -

"Missing key in bundle. Please start this activity by using the intent returned by " +

Is there a way where you can pass additional information when this activity is started (or how this activity is started)? I suspect you do?

@Monabr
Copy link
Author

Monabr commented Dec 23, 2023

@vinaygaba I am not using this activity, I am not starting it. Some other people's bots, which I have nothing to do with, enter my application and launch this activity.

@vinaygaba
Copy link
Collaborator

@Monabr Not sure how to help here if these bots are starting the activity incorrectly. I have no control over this, library is doing the right thing as it's designed to.

@Monabr
Copy link
Author

Monabr commented Dec 23, 2023

@vinaygaba We need to remove this activity from the release build; it is absolutely unnecessary there, has no use and causes problems. Or do something about this crashes so that it does not spoil the statistics.

@vinaygaba
Copy link
Collaborator

You can make Showkase only available in debug builds. Make sure your setup looks like this -

debugImplementation "com.airbnb.android:showkase:1.0.2"
kspDebug "com.airbnb.android:showkase-processor:1.0.2"

implementation "com.airbnb.android:showkase-annotation:1.0.2"

@Monabr
Copy link
Author

Monabr commented Dec 23, 2023

@vinaygaba I don’t use your dependencies directly; they probably came to me along with the Jetpack Compose dependencies. How could I fix the situation?

@vinaygaba
Copy link
Collaborator

@Monabr That's not possible. This library is an opt-in library and doesn't come by default if you use Jetpack Compose.

@Monabr
Copy link
Author

Monabr commented Dec 23, 2023

@vinaygaba I have Lottie package with com.airbnb... maybe that activity comes from their dependencies? How could I fix the situation?

@vinaygaba
Copy link
Collaborator

Lottie doesn't use Showkase so that's not possible either. I recommend spending some more time debugging as it's unrelated to the library itself and has probably something to do with your setup.

@vinaygaba vinaygaba reopened this Dec 24, 2023
@vinaygaba
Copy link
Collaborator

vinaygaba commented Dec 24, 2023

@Monabr I was able to understand the root cause of this issue -

It stems from your use of this library - https://github.com/marosseleng/compose-material3-datetime-pickers

It leverages Showkase in a way that uses it as an implementation dependency as opposed to debugImplementation like I recommended in this comment #366 (comment). If the library added a debug dependency on Showkase, it wouldn't be available in your release builds.

Moreover, this is happening because the ShowkaseBrowserActivity used to be incorrectly exported. This was fixed here - #355. However, a new release hasn't gone out since this fix was merged. So even though this issue has been fixed, it's not available yet (but will be with the new release). Hope that makes sense.

@Monabr Monabr closed this as completed Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants