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

Open
griffinsorrentino opened this issue Jun 28, 2024 · 0 comments · May be fixed by #52
Open

Android Preview does not function #51

griffinsorrentino opened this issue Jun 28, 2024 · 0 comments · May be fixed by #52

Comments

@griffinsorrentino
Copy link

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 added a commit to griffinsorrentino/FileKit that referenced this issue Jun 28, 2024
@griffinsorrentino griffinsorrentino linked a pull request Jun 28, 2024 that will close this issue
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.

1 participant