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

Android Preview does not function #51

Closed
griffinsorrentino opened this issue Jun 28, 2024 · 2 comments · Fixed by #52
Closed

Android Preview does not function #51

griffinsorrentino opened this issue Jun 28, 2024 · 2 comments · Fixed by #52

Comments

@griffinsorrentino
Copy link
Contributor

When using rememberFilePickerLauncher, the previewer in the androidMain source set stops functioning because of a ClassCastException. During preview rendering, the LocalContext.current returns a mocked BridgeContext and not a ComponentActivity

Stack Trace

java.lang.ClassCastException: class com.android.layoutlib.bridge.android.BridgeContext cannot be cast to class androidx.activity.ComponentActivity (com.android.layoutlib.bridge.android.BridgeContext is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @5b4286a7; androidx.activity.ComponentActivity is in unnamed module of loader org.jetbrains.android.uipreview.StudioModuleClassLoader @57ee5812)   at io.github.vinceglb.filekit.compose.FileKitCompose_androidKt.InitFileKit(FileKitCompose.android.kt:11)   at io.github.vinceglb.filekit.compose.FileKitComposeKt.rememberFilePickerLauncher(FileKitCompose.kt:26)

@griffinsorrentino
Copy link
Contributor Author

@vinceglb Are you by chance able to take a look into this issue and the PR?

@vinceglb
Copy link
Owner

vinceglb commented Jul 6, 2024

Thank you @griffinsorrentino for reporting this and your PR! I'm going to create a new version with your changes today

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

Successfully merging a pull request may close this issue.

2 participants