【问题标题】:Android support compat errorsAndroid 支持兼容性错误
【发布时间】:2015-07-16 14:17:14
【问题描述】:

我的项目上次运行良好。

现在我无法构建这个,我在 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 和 compileVersion 设置为 21 时,我的项目才会编译。

我使用的是 Android Studio 1.2.2。

请帮我解决这个问题。

【问题讨论】:

  • 你能发布你的清单吗?

标签: android android-studio compilation


【解决方案1】:

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

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

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

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

【讨论】:

    【解决方案2】:

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

    compileSdkVersion 21

    我以前不知道:

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-06
      • 1970-01-01
      • 1970-01-01
      • 2012-06-07
      • 2012-04-13
      • 2014-06-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多