Android支持compat错误

时间:2015-07-16 14:17:15

标签: android android-studio compilation

我的项目上次工作正常。

现在我无法构建这个,我在com.android.support/apcompat-v7/22.0.0/res/values-v21/values.xml中看到了很多问题

 Error:(47, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.

我需要为minSdkVersion 16和targetVersion 16构建我的应用程序。

只有将minSdkVersion,targetVersion和compilingVersion设置为21时,我的项目才会编译。

我使用的是Android Studio 1.2.2。

enter image description here

请帮我解决这个问题。

2 个答案:

答案 0 :(得分:1)

  

我在com.android.support/apcompat-v7/22.0.0/res/values-v21/values.xml中看到很多问题

如果您要使用compileSdkVersion版本的支持库,则22.x.y应为22。

  

我需要为minSdkVersion 16和targetVersion 16构建我的应用程序。

minSdkVersion设置为16,将targetSdkVersion设置为16,将compileSdkVersion设置为22.更改minSdkVersiontargetSdkVersion值不会导致错误你引用了。

答案 1 :(得分:0)

要解决此问题,您需要使用:

compileSdkVersion 21

我之前不知道:

compileSdkVersion - 是针对该应用编译的API的版本。这意味着您可以使用该API版本中包含的Android API功能。

minSdkVersion - 控制您说应用程序可以运行的最低级别。

targetSdkVersion - 控制任何自动应用的向后兼容性功能

相关问题