【发布时间】:2016-09-24 06:28:35
【问题描述】:
我刚刚更新到 Android Studio 2.1.1,我正在尝试构建一个发布签名的 apk,但失败并出现以下错误。我该如何解决这个问题?
':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.
这是 build.gradle(模块:app)
完整版:https://gist.github.com/anonymous/65bb2edf94ea58c50de8e0ff107555ce
...
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.company.project"
minSdkVersion 15
targetSdkVersion 23
versionCode 13
versionName "1.5"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
}
}
关于错误消息转储的更多信息 https://gist.github.com/anonymous/9d822c530011b48dab1da60267f9b471
更新:
proguard-rules.pro 的内容 https://gist.github.com/anonymous/9d822c530011b48dab1da60267f9b471
/Users/xxxx/Library/Android/sdk/tools/proguard/proguard-android.txt的内容 https://gist.github.com/anonymous/d5cdfbfd7c1bfe74d594993feb35bd62
/Users/xxxx/Library/Android/sdk/tools/proguard/proguard-project.txt的内容 https://gist.github.com/anonymous/d04cd0299029d4fdd648fb782f2e3021
【问题讨论】:
-
您需要配置您的 proguard 属性,因为您已启用它。请张贴proguard属性。从您的错误来看,由于改造有问题,请添加改造的proguard属性。
-
它看起来很空,我不熟悉proguard。这里是内容gist.github.com/anonymous/9d822c530011b48dab1da60267f9b471
-
我已经包含了 sdk proguard-android.txt 和 proguard-project.txt
-
查看Retrofit 添加proguard 规则。
-
还是同样的错误。我在 sdk sdk proguard-android.txt - gist.github.com/anonymous/d0736683ad5cc0cb5939c9bf3463dbfd 中包含了改造规则
标签: android android-studio apk release sign