【问题标题】:No resource found that matches the given name: 'android:TextAppearance.Material.Widget.Button.Inverse'找不到与给定名称匹配的资源:'android:TextAppearance.Material.Widget.Button.Inverse'
【发布时间】:2016-09-26 01:10:29
【问题描述】:

项目运行良好。我尝试添加一个片段,但出现以下错误。

检索项目的父项时出错:找不到与给定名称“android:TextAppearance.Material.Widget.Button.Inverse”匹配的资源。 检索项目的父项时出错:找不到与给定名称“android:Widget.Material.Button.Colored”匹配的资源。

错误:任务 ':app:processDebugResources' 执行失败。 com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Th\AndroidSdk\build-tools\21.1.1\aapt.exe'' 完成非零退出值 1

我没有改变任何东西。

分级:

compileSdkVersion 21
buildToolsVersion "21.1.1"

defaultConfig {
    applicationId "com.example.app.app"
    minSdkVersion 14
    targetSdkVersion 21
    multiDexEnabled = true
}

请指导我。 谢谢。

【问题讨论】:

  • 你更新 Android Studio 了吗?
  • 我早就更新过了。这是 2.1.1
  • 试试这个:compileSdkVersion 23buildToolsVersion "23.0.2"targetSdkVersion 23compile 'com.android.support:appcompat-v7:23.1.1'compile 'com.android.support:design:23.1.1'
  • 因此,默认情况下,在新版本中,当您添加新活动或片段时,它使用 API 级别 23。
  • 如果您已经更新到 23 则可以。

标签: java android gradle


【解决方案1】:

enter image description here

如图所示,问题就解决了!

【讨论】:

  • 只需将“编译 SDK 版本”设置为 API 23 或更高版本!
【解决方案2】:
targetSdkVersion 21

这不起作用,因为 API 22 及以下版本没有 API 23+ 之类的材料设计(您根据错误尝试使用)。您必须使用 AppCompat v21。这个问题也可以帮助你回答你的问题:Implement material design in android 5.0 and lower

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多