问题
I have enabled proguard for my project and I get this exception when I build signed APK
Warning:com.google.android.gms.internal.zzbkq: can't find referenced method 'int zzaT(android.os.Parcel)' in program class com.google.android.gms.common.internal.safeparcel.zzb
Warning:com.google.android.gms.internal.zzbkq: can't find referenced method 'int zzaU(android.os.Parcel)' in program class com.google.android.gms.common.internal.safeparcel.zzb
Warning:com.google.android.gms.internal.zzbkq: can't find referenced method 'int zzcW(int)' in program class com.google.android.gms.common.internal.safeparcel.zzb
Warning:com.google.android.gms.internal.zzbkq: can't find referenced method 'int zzaV(android.os.Parcel)' in program class com.google.android.gms.common.internal.safeparcel.zzc
Warning:com.google.android.gms.internal.zzbkr$zza: can't find referenced class com.google.android.gms.dynamic.zzd$zza
Warning:com.google.android.gms.internal.zzbks: can't find referenced field 'com.google.android.gms.dynamite.DynamiteModule$zzb zzaQy' in program class com.google.android.gms.dynamite.DynamiteModule
Warning:com.google.android.gms.internal.zzbks: can't find referenced method 'android.os.IBinder zzdX(java.lang.String)' in program class com.google.android.gms.dynamite.DynamiteModule
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapn
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapn$zza
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapn$zzb
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapn$zzc
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapn$zzd
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapo
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapr
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapn
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapo
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapr
Warning:com.google.android.gms.internal.zzbku: can't find referenced class com.google.android.gms.internal.zzapn
Warning:com.google.firebase.crash.FirebaseCrash: can't find referenced class com.google.android.gms.internal.zzapn
W arning:com.google.firebase.crash.FirebaseCrash: can't find referenced method 'com.google.android.gms.dynamic.zzd zzA(java.lang.Object)' in program class com.google.android.gms.dynamic.zze
Warning:com.google.firebase.crash.FirebaseCrash: can't find referenced class com.google.android.gms.internal.zzapn
Warning:com.google.firebase.crash.FirebaseCrash: can't find referenced method 'com.google.firebase.iid.zzc zzaab()' in program class com.google.firebase.iid.zzc
Warning:there were 45 unresolved references to classes or interfaces.
Warning:there were 8 unresolved references to program class members.
Error:Uncaught translation error: com.android.dx.cf.code.SimException: com.android.dx.rop.cst.CstMethodRef cannot be cast to com.android.dx.rop.cst.CstInterfaceMethodRef
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list D:\Studio Workspace\JB\app\build\intermediates\multi-dex\release\maindexlist.txt --output D:\Studio Workspace\JB\app\build\intermediates\transforms\dex\release\folders\1000\1f\main D:\Studio Workspace\JB\app\build\intermediates\transforms\proguard\release\jars\3\1f\main.jar}
This is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.vfirst.jb"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.github.gcacace:signature-pad:1.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
How do I resolve this error?
This is my proguard content-ignorewarnings
-keep class * {
public void *(android.view.View);
public private *;
}
来源:https://stackoverflow.com/questions/44199589/simexception-on-proguard-build-android-studio