在 Android Studio 中不显示 com.android.library 模块的“部署预览”按钮

tim*_*tim 1 android android-studio android-jetpack-compose

我可能遗漏了一些明显的东西,但我无法在 Android Studio 中显示“部署预览”按钮。

\n

在此输入图像描述

\n

但是,如果我打开Android Compose Samples,我就会看到它们。

\n

我检查了它们的依赖关系并将它们应用到我的应用程序中,但我仍然看不到它们。

\n
implementation "androidx.compose.runtime:runtime:1.1.0-rc01"\nimplementation "androidx.compose.material:material:1.1.0-rc01"\nimplementation "androidx.compose.foundation:foundation:1.1.0-rc01"\nimplementation "androidx.compose.foundation:foundation-layout:1.1.0-rc01"\nimplementation "androidx.compose.ui:ui-tooling:1.1.0-rc01"\nimplementation "androidx.compose.animation:animation:1.1.0-rc01"\nimplementation \'androidx.activity:activity-compose:1.1.0-rc02\'\ndebugImplementation "androidx.compose.ui:ui-test-manifest:1.1.0-rc01"\n
Run Code Online (Sandbox Code Playgroud)\n

为了让此部署预览显示,我缺少什么?

\n

编辑

\n

需要明确的是,我可以毫无问题地显示预览。
\n但没有部署预览按钮。

\n

在此输入图像描述

\n

编辑2

\n

我注意到该按钮仅出现在\'com.android.application\'模块中,而不出现在\'com.android.library\'模块 \xc2\xaf_(\xe3\x83\x84)_/\xc2\xaf中

\n

tim*_*tim 5

此行为仅在 Android 库中可见。

plugins {
    id 'com.android.library'
    ...
}

android {
    compileSdk 31

    defaultConfig {
        minSdk 21
        ... 
...
Run Code Online (Sandbox Code Playgroud)

这是Android Studio 中的一个已知错误。

不幸的是,除了这个问题之外,没有任何地方记录它。
它已在花栗鼠金丝雀 2中修复