我可以运行该项目 但我发现,如果我添加到很多文件,当我构建项目时,android studio将显示错误 这是错误
信息:Gradle任务[:app:assembleRelease] :app:preBuild UP-TO-DATE :app:preReleaseBuild UP-TO-DATE :应用:checkReleaseManifest :app:preDebugBuild UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2330Library UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72330Library UP-TO-DATE :app:prepareComAndroidSupportDesign2311Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42330Library UP-TO-DATE :app:prepareComAndroidSupportSupportVectorDrawable2330Library UP-TO-DATE :应用:prepareReleaseDependencies :应用:compileReleaseAidl :应用:compileReleaseRenderscript :应用:generateReleaseBuildConfig :应用:mergeReleaseShaders :应用:compileReleaseShaders :应用:generateReleaseAssets :应用:mergeReleaseAssets :app:generateReleaseResValues UP-TO-DATE :应用:generateReleaseResources :应用:mergeReleaseResources :应用:processReleaseManifest :app:processReleaseResources FAILED 错误:任务':app:processReleaseResources'执行失败。 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令' C:\ Users \ k03 \ AppData \ Local \ Android \ sdk \ build-tools \ 23.0.3 \ aapt.exe''完成非零退出值1
我尝试clean project
和rebuild project
,但仍显示相同的错误
这是gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.k03.vv"
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.3.0'
compile 'com.android.support:design:23.1.1'
compile 'com.google.code.gson:gson:2.5'
}
答案 0 :(得分:0)
之前我遇到过这个问题。通常,原因是您的某些资产不符合Android Studio的规格。尝试批量添加资产,并在每次之后执行clean project
。然后找到坏的并修复它。
希望有所帮助。