生成已签名的apk时,有504个错误,后面有输出。 请让我知道我做错了什么。
提前致谢...
Error:Execution failed for task
':app:transformClassesAndResourcesWithProguardForRelease'.
Job failed, see logs for details
Information:BUILD FAILED
Information:Total time: 1 mins 7.38 secs
Information:1 error
Information:1,097 warnings
Information:See complete output in console
Proguard是 -
-keep class com.facebook.** { *;}
-keepattributes Signature
-keep class com.bumptech.glide.integration.okhttp3.OkHttpGlideModule
添加了依赖项 -
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:design:25.1.0'
testCompile 'junit:junit:4.12'
compile 'net.sourceforge.jexcelapi:jxl:2.6.12'
compile 'com.facebook.android:facebook-android-sdk:4.18.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.github.barteksc:android-pdf-viewer:2.4.0'
provided 'org.androidannotations:androidannotations:4.0.0'
compile 'org.androidannotations:androidannotations-api:4.0.0'
}
apply plugin: 'com.google.gms.google-services'
答案 0 :(得分:0)
当SDK,Build Tools和Gradle Plugins的版本不匹配时(在兼容性方面),会发生此错误。解决方案是验证您是否使用它们的最新版本。 gradle插件放在项目的build.gradle文件中。其他版本位于模块的build.gradle文件中。例如,对于SDK 25,您必须使用Build Tools 25.0.2和gradle plugins 2.2.3版。
更改设置后清洁项目。