我有Gradle
!“错误:(2)错误检索的项目父无资源发现,给定名称匹配的‘机器人:TextAppearance.Material.Widget.Button.Inverse’
它一直显示的问题我的错误,可有一个人帮我解决这个问题
注:这是我第一次安装Android工作室
我有Gradle
!“错误:(2)错误检索的项目父无资源发现,给定名称匹配的‘机器人:TextAppearance.Material.Widget.Button.Inverse’
它一直显示的问题我的错误,可有一个人帮我解决这个问题
注:这是我第一次安装Android工作室
试试吧
编译 “com.android.support:appcompat-v7:23.0.1”
,你可以改变targetSdkVersion 23
尝试使用这样的:
compile 'com.android.support:appcompat-v7:24.1.0'
使用最新的支持库并更改您的目标并编译SDK也
compileSdkVersion 24
buildToolsVersion “24.0.1”
targetSdkVersion 24
请使用我的项目gradle这个值并更新SDK库:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
multiDexEnabled true
applicationId "com.example.student" //change as your package name
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
}
尝试匹配所有版本:
compileSdkVersion 23 buildToolsVersion '23.0.0' targetSdkVersion 23
添加以下依赖关系: 编译 'com.android.support:appcompat-v7:23.0.0'
请确保您使用最新版本的SDK: how to update sdk
问题是你使用
compile 'com.android.support:appcompat-v7:19.+'
它给你所有可能的Android 4.4.2 Kitkat API 19和更旧的版本。
在你的项目,你正在尝试使用材料主题属于较新的版本,我的意思是com.android.support:appcompat:$version
,其中version>与Android的5推出21
材料设计。1棒棒糖API 21
我higly reccomend你到你build.gradle
文件更改为:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:24.2.1"
}
当然改变appcompat
库版本:
com.android.support:appcompat-v7:23.0.1"
就足够了;-)
希望它会帮助
尝试使用t他的'编译'com.android.support:appcompat-v7:21.1.0'' – Priyanka
使用最新的支持库并针对最新的sdk进行编译。 [检查此](http://stackoverflow.com/questions/32075498/error-retrieving-parent-for-item-no-resource-found-that-matches-the-given-name) – Raghavendra
检查https://代码.google.com/p/android/issues/detail?id = 183149 – piotrek1543