人生处万类,知识最为贤。这篇文章主要讲述错误 - Android Studio - Gradle Ask相关的知识,希望能为你提供帮助。
我在android Studio中收到这些错误:
Error:(9, 5) error: style attribute 'attr/colorError (aka com.kevinladelfa.duevent:attr/colorError)' not found.
Error:(11, 5) error: style attribute 'attr/colorPrimary (aka com.kevinladelfa.duevent:attr/colorPrimary)' not found.
C:Userskevin.gradlecaches ransforms-1files-1.1appcompat-v7-26.1.0.aar55eaded1d173457b819b46407cb2076d
esvalues-v26values-v26.xml
Error:(11, 5) error: style attribute 'attr/colorAccent (aka com.kevinladelfa.duevent:attr/colorAccent)' not found.
Error:(11, 5) error: style attribute 'attr/colorPrimaryDark (aka com.kevinladelfa.duevent:attr/colorPrimaryDark)' not found.
C:Userskevin.gradlecaches ransforms-1files-1.1cardview-v7-26.1.0.aarc45ee84ab726285b089716ddfdae856c
esvaluesvalues.xml
Error:(13, 5) error: style attribute 'attr/colorError (aka com.kevinladelfa.duevent:attr/colorError)' not found.
C:Userskevin.gradlecaches ransforms-1files-1.1appcompat-v7-26.1.0.aar55eaded1d173457b819b46407cb2076d
esvalues-v17values-v17.xml
Error:(27, 5) error: resource dimen/abc_dropdownitem_text_padding_left (aka com.kevinladelfa.duevent:dimen/abc_dropdownitem_text_padding_left) not found.
Error:resource style/Theme.AppCompat.Light.DarkActionBar (aka com.kevinladelfa.duevent:style/Theme.AppCompat.Light.DarkActionBar) not found.
C:UserskevinDesktopDueventappuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml
Error:(183) style attribute 'attr/colorPrimary (aka com.kevinladelfa.duevent:attr/colorPrimary)' not found.
Error:(184) style attribute 'attr/colorPrimaryDark (aka com.kevinladelfa.duevent:attr/colorPrimaryDark)' not found.
Error:(185) style attribute 'attr/colorAccent (aka com.kevinladelfa.duevent:attr/colorAccent)' not found.
Error:resource style/Base.Theme.AppCompat.Dialog.FixedSize (aka com.kevinladelfa.duevent:style/Base.Theme.AppCompat.Dialog.FixedSize) not found.
Error:resource style/Base.Theme.AppCompat.Light.Dialog.FixedSize (aka com.kevinladelfa.duevent:style/Base.Theme.AppCompat.Light.Dialog.FixedSize) not found.
Error:resource style/Base.V7.Widget.AppCompat.AutoCompleteTextView (aka com.kevinladelfa.duevent:style/Base.V7.Widget.AppCompat.AutoCompleteTextView) not found.
Error:resource style/Base.V7.Widget.AppCompat.EditText (aka com.kevinladelfa.duevent:style/Base.V7.Widget.AppCompat.EditText) not found.
Error:resource style/Base.V14.Widget.Design.AppBarLayout (aka com.kevinladelfa.duevent:style/Base.V14.Widget.Design.AppBarLayout) not found.
Error:resource style/Base.V23.Theme.AppCompat (aka com.kevinladelfa.duevent:style/Base.V23.Theme.AppCompat) not found.
Error:resource style/Base.V23.Theme.AppCompat.Light (aka com.kevinladelfa.duevent:style/Base.V23.Theme.AppCompat.Light) not found.
C:UserskevinDesktopDueventappuildintermediatesincrementalmergeDebugResourcesmerged.dirvalues-v26values-v26.xml
Error:(7) style attribute 'attr/colorError (aka com.kevinladelfa.duevent:attr/colorError)' not found.
Error:(11) style attribute 'attr/colorError (aka com.kevinladelfa.duevent:attr/colorError)' not found.
Error:resource style/Base.V7.Widget.AppCompat.Toolbar (aka com.kevinladelfa.duevent:style/Base.V7.Widget.AppCompat.Toolbar) not found.
Error:resource style/Base.Widget.AppCompat.DrawerArrowToggle.Common (aka com.kevinladelfa.duevent:style/Base.Widget.AppCompat.DrawerArrowToggle.Common) not found.
C:UserskevinDesktopDueventappuildintermediatesincrementalmergeDebugResourcesmerged.dirvalues-hdpi-v4values-hdpi-v4.xml
Error:(4) error: style attribute 'attr/barLength (aka com.kevinladelfa.duevent:attr/barLength)' not found.
Error:(5) error: style attribute 'attr/gapBetweenBars (aka com.kevinladelfa.duevent:attr/gapBetweenBars)' not found.
Error:(6) error: style attribute 'attr/drawableSize (aka com.kevinladelfa.duevent:attr/drawableSize)' not found.
Error:(4) style attribute 'attr/barLength (aka com.kevinladelfa.duevent:attr/barLength)' not found.
Error:(5) style attribute 'attr/gapBetweenBars (aka com.kevinladelfa.duevent:attr/gapBetweenBars)' not found.
Error:(6) style attribute 'attr/drawableSize (aka com.kevinladelfa.duevent:attr/drawableSize)' not found.
Error:resource style/Base.DialogWindowTitle.AppCompat (aka com.kevinladelfa.duevent:style/Base.DialogWindowTitle.AppCompat) not found.
C:UserskevinDesktopDueventappuildintermediatesincrementalmergeDebugResourcesmerged.dirvalues-v17values-v17.xml
Error:(24) resource dimen/abc_dropdownitem_text_padding_left (aka com.kevinladelfa.duevent:dimen/abc_dropdownitem_text_padding_left) not found.
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'.
Failed to execute aapt
我的Gradle:
buildscript {repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
}
}allprojects {
repositories {
google()
jcenter()
}
}task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'android {
compileSdkVersion 26
defaultConfig {
applicationId "com.kevinladelfa.duevent"
minSdkVersion 22
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4.2'
compile 'com.google.firebase:firebase-firestore:11.4.2'
}
答案所有错误“颜色错误或字体错误”来自graddle / app中更高版本的firebase ui。尝试使用它的较低版本。
或尝试使用此:
maven {
url 'https://maven.google.com'
}
文章图片
你可以随时检查:https://firebase.google.com/support/release-notes/android
并尝试添加此:
android {
compileSdkVersion 26
buildToolsVersion "26.1.0"
defaultConfig {
applicationId "..."
minSdkVersion 22
targetSdkVersion 26
【错误 - Android Studio - Gradle Ask】或者减少sdk和AppCompat版本以检查较低版本是否正常工作。
compileSdkVersion 25
buildToolsVersion "25.3.1"
defaultConfig {
applicationId "..."
minSdkVersion 22
targetSdkVersion 25
....
'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
等等。
此外,不要忘记在一周内至少重启一次Mac)模拟器效果更好
推荐阅读
- Android Studio 3.0.1中的gradle项目同步失败
- Hadoop Mapper参数含义
- 从Android Things设备上的应用程序中选择WiFi网络(Raspberry Pi 3)
- 如何使用autolayout将UIScrollView滚动到viewWillAppear的底部,没有可视化动画
- “离子cordova运行android”无法使用cordova-android@7.0.0
- 如何使用Android中的Camera.Parameter在黑白模式下打开和捕捉相机图片
- win10怎样设置宽带连接,本文教您修好宽带连接问
- windows10 cmd|本文教您windows10系统下cmd命令大全
- Win10怎样退回Win 8,本文教您怎样退回