错误:资源android:style / TextAppearance.Material.Widget.Button.Borderless.Colored not found [英] Error:resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found
问题描述
我正在尝试构建一个具有compileSdkVersion 25和targetSdkVersion 25的项目但是我需要将两者都更改为23所以在更改compileSdkVersion 23和targetSdkVersion 23后我收到错误
I am trying to build a project that has compileSdkVersion 25 and targetSdkVersion 25 but I need to change both to 23 so after changing compileSdkVersion 23 and targetSdkVersion 23 I am getting an error
错误:资源
android:style / TextAppearance.Material.Widget.Button.Borderless.Colored未找到
。错误:资源
android:style / TextAppearance.Material.Widget.Button.Colored未找到。
错误:链接引用失败。
错误:java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception:AAPT2错误:检查
的日志详细信息错误:java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception:AAPT2错误:检查
详细信息日期错误:com.android.tools.aapt2.Aapt2Exception:AAPT2错误:
检查日志以获取详细信息错误:任务执行失败
':app:processDebugResources'。
Error:resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found. Error:resource android:style/TextAppearance.Material.Widget.Button.Colored not found. Error:failed linking references. Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details Error:Execution failed for task ':app:processDebugResources'.
无法执行执行aapt
Failed to execute aapt
我是一名iOS开发人员,在Android方面没有太多经验,我无法找到代码中的错误点以及修复方法。
I am an iOS developer and doesn't have much experience in Android, I am unable to find where this error point in code and how to fix.
编辑:1
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '26.0.2'
defaultConfig {
applicationId 'com.abc.app'
minSdkVersion 21
targetSdkVersion 23
versionCode 4
versionName '1.3'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField("String", "API_KEY", "\"empty\"")
//buildConfigField("String", "API_KEY", API_KEY)
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec'
exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:customtabs:25.4.0'
implementation 'com.android.support:cardview-v7:25.4.0'
implementation 'com.nex3z:toggle-button-group:1.1.2'
implementation 'com.github.ivbaranov:materialfavoritebutton:0.1.4'
implementation 'com.android.support:design:25.4.0'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
implementation 'com.yqritc:recyclerview-flexibledivider:1.2.9'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'com.github.bumptech.glide:glide:4.3.1'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
implementation('com.github.fcopardo:easyrest:v1.4.2@aar') {
transitive = true
}
// compile 'com.github.wrdlbrnft:sorted-list-adapter:0.3.0.27'
testImplementation 'junit:junit:4.12'
}
推荐答案
android:style / TextAppearance.Material.Widget.Button。在API 24中添加了Borderless.Colored,因此您无法在版本23中使用它。您可以使用在版本23之前添加的样式。您还可以将新样式应用于较新版本的设备并将旧样式应用为默认样式: https://developer.android.com/指南/主题/ ui / look-and-feel / themes.html#Versions
android:style/TextAppearance.Material.Widget.Button.Borderless.Colored was added in API 24 so you can't use it with version 23. You can use a style that was added before version 23. You can also apply new styles to newer-versioned devices and apply an old style as a default: https://developer.android.com/guide/topics/ui/look-and-feel/themes.html#Versions
已添加 03/20 / '18 12:32
Added 03/20/'18 12:32
由于您不熟悉Android,一个简单的解决方案就是使用较旧的文本外观。这至少使应用程序在您的Android 5设备上运行。之后,您可以了解如何进一步自定义TextView,但现在让我们让它工作。
As you're not familiar with Android, a simple solution is to just use an older text appearance. This at least makes the app working on your Android 5 device. Afterwards you can learn about how to further customize the TextView, but for now let's just make it work.
- 可以为位于[something] / res / layout / xxx的布局文件中的某个TextView设置文本的外观。 xml,布局也可以是layout-xxx。
- 它可以在样式文件中设置,位于[something] /res/values/styles.xml,values也可以是values-xxx。
文件夹res可以在Android Studio的项目树中轻松找到。
您也可以使用 Ctrl + Shift + F 可在整个项目中搜索。
当您找到它时,只需删除或注释该行。
folder "res" can be easily found from the project tree in Android Studio.
You can also use Ctrl+Shift+F to search in whole project.
When you find it, just delete or comment the line.
这篇关于错误:资源android:style / TextAppearance.Material.Widget.Button.Borderless.Colored not found的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!