【发布时间】:2018-01-18 16:54:20
【问题描述】:
2 周来,我无法在 android studio 中构建我的任何应用程序,这变得相当令人沮丧。
我收到以下错误:
- 错误:找不到资源样式/Base.AlertDialog.AppCompat(又名 com.almac.engineerapp:style/Base.AlertDialog.AppCompat)。
- 错误:java.util.concurrent.ExecutionException:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2 错误:查看日志了解详情
我知道您可以在 gradle.properties 中执行 appt2.enable = false 但这对我不起作用。
我还确保我的构建工具是 26.0.2 或其他帖子建议的类似工具,但这没有用。
我没有看到任何其他解决方案,虽然这很相似,但我不认为这是重复的帖子。
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.almac.engineerapp"
minSdkVersion 25
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'
implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
implementation 'com.android.volley:volley:1.1.0'
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'
}
有人可以帮忙吗
【问题讨论】:
-
它是否建立在命令行上?您可以删除所有构建文件及其依赖项,然后将项目作为源文件的集合导入。如果您在构建脚本中找不到错误,我会这样做。
-
我不太确定如何使用命令行。刚刚向我展示了如何通过 IDE 正常运行应用程序