【发布时间】:2018-07-07 09:24:08
【问题描述】:
我刚刚在 Android Studio 中创建了一个新项目,在 gradle 构建之后它显示以下错误。我不知道为什么会这样。
Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
C:\Users\DEVPC\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\4a763fb9bbd72a5413be967c96404ad9\res\values-v11\values-v11.xml
Error:(67, 5) error: resource style/Widget.AppCompat.Button.Borderless (aka com.asif047.includinglibrary2:style/Widget.AppCompat.Button.Borderless) not found.
Error:(67, 5) error: resource style/Widget.AppCompat.ButtonBar.AlertDialog (aka com.asif047.includinglibrary2:style/Widget.AppCompat.ButtonBar.AlertDialog) not found.
Error:(72, 5) error: resource style/Widget.AppCompat.ButtonBar.AlertDialog (aka com.asif047.includinglibrary2:style/Widget.AppCompat.ButtonBar.AlertDialog) not found.
Error:(72, 5) error: resource style/Widget.AppCompat.Button.Borderless (aka com.asif047.includinglibrary2:style/Widget.AppCompat.Button.Borderless) not found.
Error:(77, 5) error: resource style/Widget.AppCompat.ButtonBar.AlertDialog (aka com.asif047.includinglibrary2:style/Widget.AppCompat.ButtonBar.AlertDialog) not found.
Error:(77, 5) error: resource style/Widget.AppCompat.Button.Borderless (aka com.asif047.includinglibrary2:style/Widget.AppCompat.Button.Borderless) not found.
C:\Users\DEVPC\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\4a763fb9bbd72a5413be967c96404ad9\res\values-v21\values-v21.xml
Error:(49, 5) error: resource string/abc_font_family_title_material (aka com.asif047.includinglibrary2:string/abc_font_family_title_material) not found.
Error:(49, 5) error: resource dimen/abc_text_size_menu_header_material (aka com.asif047.includinglibrary2:dimen/abc_text_size_menu_header_material) not found.
Error:(111, 5) error: resource dimen/abc_floating_window_z (aka com.asif047.includinglibrary2:dimen/abc_floating_window_z) not found.
Error:resource style/Theme.AppCompat.Light.DarkActionBar (aka com.asif047.includinglibrary2:style/Theme.AppCompat.Light.DarkActionBar) not found.
E:\E-COMMERCE NEW\IncludingLibrary2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v14\values-v14.xml
Error:(4) error: resource dimen/abc_text_size_button_material (aka com.asif047.includinglibrary2:dimen/abc_text_size_button_material) not found.
Error:(4) resource dimen/abc_text_size_button_material (aka com.asif047.includinglibrary2:dimen/abc_text_size_button_material) not found.
Error:resource style/Base.Theme.AppCompat.Dialog.FixedSize (aka com.asif047.includinglibrary2:style/Base.Theme.AppCompat.Dialog.FixedSize) not found.
Error:resource style/TextAppearance.AppCompat (aka com.asif047.includinglibrary2:style/TextAppearance.AppCompat) not found.
Error:resource style/Base.Theme.AppCompat.Light.Dialog.FixedSize (aka com.asif047.includinglibrary2:style/Base.Theme.AppCompat.Light.Dialog.FixedSize) not found.
Error:resource style/Base.V7.Theme.AppCompat.Light.Dialog (aka com.asif047.includinglibrary2:style/Base.V7.Theme.AppCompat.Light.Dialog) not found.
Error:resource style/Base.V7.Theme.AppCompat.Dialog (aka com.asif047.includinglibrary2:style/Base.V7.Theme.AppCompat.Dialog) not found.
Error:resource style/Base.V7.ThemeOverlay.AppCompat.Dialog (aka com.asif047.includinglibrary2:style/Base.V7.ThemeOverlay.AppCompat.Dialog) not found.
E:\E-COMMERCE NEW\IncludingLibrary2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v11\values-v11.xml
Error:(63) resource style/Widget.AppCompat.ButtonBar.AlertDialog (aka com.asif047.includinglibrary2:style/Widget.AppCompat.ButtonBar.AlertDialog) not found.
Error:(64) resource style/Widget.AppCompat.Button.Borderless (aka com.asif047.includinglibrary2:style/Widget.AppCompat.Button.Borderless) not found.
Error:(68) resource style/Widget.AppCompat.ButtonBar.AlertDialog (aka com.asif047.includinglibrary2:style/Widget.AppCompat.ButtonBar.AlertDialog) not found.
Error:(69) resource style/Widget.AppCompat.Button.Borderless (aka com.asif047.includinglibrary2:style/Widget.AppCompat.Button.Borderless) not found.
Error:(73) resource style/Widget.AppCompat.ButtonBar.AlertDialog (aka com.asif047.includinglibrary2:style/Widget.AppCompat.ButtonBar.AlertDialog) not found.
Error:(74) resource style/Widget.AppCompat.Button.Borderless (aka com.asif047.includinglibrary2:style/Widget.AppCompat.Button.Borderless) not found.
Error:resource style/Base.V7.Widget.AppCompat.AutoCompleteTextView (aka com.asif047.includinglibrary2:style/Base.V7.Widget.AppCompat.AutoCompleteTextView) not found.
Error:resource style/Base.V7.Widget.AppCompat.EditText (aka com.asif047.includinglibrary2:style/Base.V7.Widget.AppCompat.EditText) not found.
Error:resource style/Base.V7.Theme.AppCompat (aka com.asif047.includinglibrary2:style/Base.V7.Theme.AppCompat) not found.
E:\E-COMMERCE NEW\IncludingLibrary2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v21\values-v21.xml
Error:(50) resource dimen/abc_text_size_menu_header_material (aka com.asif047.includinglibrary2:dimen/abc_text_size_menu_header_material) not found.
Error:(49) resource string/abc_font_family_title_material (aka com.asif047.includinglibrary2:string/abc_font_family_title_material) not found.
Error:(113) resource dimen/abc_floating_window_z (aka com.asif047.includinglibrary2:dimen/abc_floating_window_z) 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 文件信息:
> apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.asif047.includinglibrary2"
minSdkVersion 15
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.1.2'
testImplementation 'junit:junit:4.12'
}
【问题讨论】:
-
放入gradle文件和gradle版本详情。
-
我已经编辑并给出了gradle文件信息@AbhayKoradiya
-
你试过
clean和re-build项目吗? -
检查here。
标签: android android-gradle-plugin android-support-library android-styles