gpt4 book ai didi

android - 无法为min = targetSdkVersion = 10的应用添加支持库

转载 作者:行者123 更新时间:2023-12-03 05:18:03 28 4
gpt4 key购买 nike

我正在尝试将Android支持库(appcompat)添加到空项目,该空项目仅分配用于API级别10。

因此,我使用以下选项创建Android Studio项目。

然后,在依赖项区域中添加支持库。

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'

repositories {
mavenCentral()
}

android {
compileSdkVersion 10
buildToolsVersion "18.0.1"

defaultConfig {
minSdkVersion 10
targetSdkVersion 10
}
}

dependencies {
compile 'com.android.support:appcompat-v7:18.0.0'
}

然后我得到以下编译错误
MyAppProject/MyApp/build/exploded-bundles/ComAndroidSupportAppcompatV71800.aar/res/values-v14/values.xml
Gradle: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Holo.SearchResult.Subtitle'.
Gradle: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Holo.SearchResult.Title'.
Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu.Large'.
...

MyAppProject/MyApp/build/exploded-bundles/ComAndroidSupportAppcompatV71800.aar/res/values-v11/values.xml
Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'.
Gradle: No resource found that matches the given name: attr 'android:windowActionBar'.
...

最佳答案

因为在项目中使用了Android 3.0+中的资源,所以会收到错误消息:'android:Theme.Holo'

只需将targetSDKVersion设置为> 11。

Undersanding min/targetSdkVersion

关于android - 无法为min = targetSdkVersion = 10的应用添加支持库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19051277/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com