【发布时间】:2015-02-14 20:58:17
【问题描述】:
我无法为我的应用生成签名的 APK,我遇到错误 java.io.IOException Execution failed for task:'app:proguardRelease' 我有我认为是基本 gradle 文件的内容,请参见下文
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.okason.clients"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.api-client:google-api-client:1.19.0'
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
}
生成的 Proguard-rules.pro 文件是空的,我没有接触 SDK 中的 proguard-android.txt 文件。我什至尝试将此文件复制到 app 的根目录,使其与 app.gradle 文件位于同一位置,但没有成功。
我尝试按照[SO Question][1] 成功运行此命令 gradlew.bat assembleRelease。请有人看看,让我知道我做错了什么。我已将 SDK 和 Android Studio 更新到最新版本。
【问题讨论】:
-
您遇到的确切错误是什么?有各种各样的 IOExceptions。
-
这里是任务执行失败的错误:'app:proguardRelease
标签: android proguard android-gradle-plugin