[Bug]: Run Preview on emulator/device not working for core:designsystem

Open
#1,605 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, kotlin
Domain
mobile

Research direction

Start by reproducing the NiaButtonPreview - Dark theme failure in Android Studio Koala and compare the core:designsystem previews with the working previews in core:ui, including how both modules are connected to the app module. Done means the core:designsystem previews can run on an emulator or device without the unsupported run-configuration error.

Written by the indexing model from the issue text.

Description

bug
Is there an existing issue for this?
  • I have searched the existing issues
Is there a StackOverflow question about this issue?
  • I have searched StackOverflow
What happened?

Android Studio version: Koala Feature Drop | 2024.1.2
Ref: 447cd7eba311c9cb4b4f302bf632fe8bd4e9784c (latest main branch as of this writing)

When trying to run a for example the NiaButtonPreview inside the core:designsystem package, I get this error:

Error: Run configuration NiaButtonPreview - Dark theme is not supported in the current project.
Cannot obtain the package.

The same issue appears for all the other previews in core:designsystem, but the previews in core:ui work fine.

Is this some limitation of Compose and/or Android Studio? As I can't really find any significant configuration changes between core:ui and core:designsystem, they both are direct dependencies of the app module.

Relevant logcat output

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
Kotlin
Stars
22.1k
Forks
4.7k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from android/nowinandroid

All issues in android/nowinandroid

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.