ProGuard不断给出错误,不让我构建签名的APK: (full console output)
红线:
Warning: com.package.name.MainActivity$20$1: can't find referenced field 'android.widget.RadioGroup val$dialogReport' in program class com.package.name.MainActivity$20
Warning: com.package.name.MainActivity$20$1: can't find referenced field 'android.support.v7.app.AlertDialog val$dialog' in program class com.package.name.MainActivity$20
Warning: com.package.name.MainActivity$20$1: can't find enclosing method 'void onShow(android.content.DialogInterface)' in program class com.package.name.MainActivity$20
Warning: com.package.name.MainActivity$8$1: can't find referenced method 'int access$1100()' in program class com.package.name.MainActivity
Warning: com.package.name.MainActivity$8$1: can't find referenced method 'android.support.v4.util.ArrayMap access$1200()' in program class com.package.name.MainActivity
Warning: com.package.name.MainActivity$8$1: can't find referenced class com.package.name.MainActivity$DeleteSpotTask
Warning: com.package.name.MainActivity$8$1: can't find referenced class com.package.name.MainActivity$DeleteSpotTask
Warning: com.package.name.MainActivity$8$1: can't find referenced class com.package.name.MainActivity$DeleteSpotTask
Warning: com.package.name.MainActivity$8$1: can't find referenced method 'android.support.v4.util.ArrayMap access$1500()' in program class com.package.name.MainActivity
Warning: com.package.name.MainActivity$8$1: can't find referenced method 'void access$1600(com.package.name.MainActivity)' in program class com.package.name.MainActivity
我的build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
此问题在将com.android.tools.build:gradle:3.0.0
更新为com.android.tools.build:gradle:3.0.1
后开始发生。
com.android.tools.build:gradle:3.0.0
答案 0 :(得分:1)
在gradle部分中转到gradle-wrapper.properties文件
更改distributionUrl,
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip