【发布时间】:2015-01-29 07:54:48
【问题描述】:
我试图编译一个 API 级别为 16 的 Android。但是,我遇到了以下错误。现在是否可以使用 android studio 或 Eclipse 编译 API 级别 16 的应用程序?
Error:(50, 21) No resource found that matches the given name: attr android:actionModeShareDrawable'
Error:(6, 21) No resource found that matches the given name: attr 'android:paddingEnd'
Error:(11, 21) No resource found that matches the given name: attr 'android:layout_marginEnd'
Error:(10, 21) No resource found that matches the given name: attr 'android:paddingStart'.
Error:(6, 21) No resource found that matches the given name: attr 'android:paddingEnd'
Error:(24, 21) No resource found that matches the given name: attr 'android:layout_marginStart'.
Error goes like that.. Total 118 errors..
以下是我在 Android Studio 中安装的内容:
- Android SDK 工具 24.0.2
- Android SDK平台-工具21
- Android SDK 构建工具 20
- Android 4.1.2 (API 16)。
我也设置了 Compile with : API level 16。
使用 API 级别 16 编译它是否还需要其他任何东西?我怎样才能摆脱这些错误?有人可以帮我吗?非常感谢。
编辑:
文件 build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
应用程序的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 16
buildToolsVersion '20'
defaultConfig {
applicationId "com.mtes.sidek.techer"
minSdkVersion 10
targetSdkVersion 16
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.3'
}
SDK 管理器:
使用设置编译:
【问题讨论】:
-
显示您的 gradle 文件。还张贴您的 SDK 管理器的图像
-
@goonerdroid,我已经添加了 SDK 管理器和 gradle 文件的图像。这个可以吗 ?谢谢。
-
将您的 buildToolsVersion 更改为 21.1.2。您还在 SDK 管理器中安装了 Google Repository、Google Support Repository、Android Support Library、Google Play services,
-
@goonerdroid,我已按照您的要求进行了更改。还是一样的错误。我已经更新了 SDK 管理器并相应地使用图像编译。但我遇到了同样的错误。
标签: android eclipse-plugin android-studio android-4.2-jelly-bean android-sdk-tools