android - 无法使用 API 级别 10 创建 Android 项目,因为没有可用的兼容主题

标签 android android-studio

我觉得我一定是忽略了这里的某些东西。我已经通过 SDK 管理器下载了 API Level 10 API。如果我尝试创建一个新项目,我不能,因为只有 Holo 主题可用,所有这些主题都至少需要 API Level 11。我没有其他主题选项,因此下一步按钮是灰色的。有没有办法指定兼容的主题?

最佳答案

如果您没有看到“无”选项,请转到这些文件并确保模板配置正确:

{Install_Path}\android-studio\plugins\android\lib\templates\gradle-projects\NewAndroidApplication\template.xml

{Install_Path}\plugins\android\lib\templates\gradle-projects\NewAndroidLibrary\template.xml
{Install_Path}\sdk\tools\templates\projects\NewAndroidApplication\template.xml
{Install_Path}\sdk\tools\templates\projects\NewAndroidLibrary\template.xml

在文本编辑器 (Notepad++) 中打开每个文件并搜索“baseTheme”。 应该有一个带有该 ID 的“parameter”xml 元素。

确保参数看起来像这样

<parameter
    id="baseTheme"
    name="Base Theme"
    type="enum"
    default="none"
    help="The base user interface theme for the library">
    <option id="none" default="true">None</option>
    <option id="holo_dark" minBuildApi="11">Holo Dark</option>
    <option id="holo_light" minBuildApi="11">Holo Light</option>
    <option id="holo_light_darkactionbar" minBuildApi="14">Holo Light with Dark Action Bar</option>
</parameter>

不是这样的:

   <parameter
        id="baseTheme"
        name="Base Theme"
        type="enum"
        default="holo_light_darkactionbar"
        help="The base user interface theme for the application">
        <option id="holo_dark" minBuildApi="11">Holo Dark</option>
        <option id="holo_light" minBuildApi="11">Holo Light</option>
        <option id="holo_light_darkactionbar" minBuildApi="14" default="true">Holo Light with Dark Action Bar</option>
    </parameter>

特别是对于文件'\android-studio\plugins\android\lib\templates\gradle-projects\NewAndroidApplication\template.xml'

关于android - 无法使用 API 级别 10 创建 Android 项目,因为没有可用的兼容主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19597298/

相关文章:

android - Android应用错误:未找到Kotlin类,但仅在Release apk上

android - 适用于 Android 的可扩展的基于图 block 的 ImageView

java - 无法在 Ubuntu 中安装 Android Studio

android - Android Studio中这两个Gradle是什么意思?

android - 在 fragment 上输入 EditText 并填充所有其他 fragment

android - 从databasehelper访问字符串资源

android - 在Android上相当于AVQueuePlayer

android - ERROR : Failed to resolve: com. android.support.constraint :constraintlayout:1. 1.3 在项目结构对话框中显示受影响的模块:app

android - 使用调试 keystore 在 Google Play 上发布 APK

android - 升级到 Android Studio 到 2.0 Preview 并使用 Instant Run 后出现 Gradle 错误