2017-12-27 671 views
1

優化應用程序後,Proguard失敗,顯示此消息。APP發佈的Proguard錯誤 - android/arch/core/internal/SafeIterableMap

compileSdkVersion = 27

buildToolsVersion = 「27.0.3」

的minSdkVersion = 16

targetSdkVersion = 27

Shrinking... Removing unused program classes and class elements... Original number of program classes: 6833 Final number of program classes: 6348 Optimizing... Unexpected error while computing stack sizes: Class = [android/arch/core/internal/SafeIterableMap$1] Method = [zzf(Ljava/lang/String;)J] Exception = [java.lang.IllegalArgumentException] (Stack size becomes negative after instruction [24] invokestatiC#4625 in [android/arch/core/internal/SafeIterableMap$1.zzf(Ljava/lang/String;)J]) Warning: Exception while processing task java.io.IOException: java.lang.IllegalArgumentException: Stack size becomes negative after instruction [24] invokestatiC#4625 in [android/arch/core/internal/SafeIterableMap$1.zzf(Ljava/lang/String;)J] Thread(Tasks limiter_5): destruction :app:transformClassesAndResourcesWithProguardForRelease FAILED

回答

2

在我的情況我通過註釋這些固定這proguard文件中的行:

#-assumenosideeffects class android.util.Log { 
# public static *** d(...); 
# public static *** v(...); 
# public static *** i(...); 
# public static *** w(...); 
# public static *** e(...); 

我結束了對每個日誌使用if(BuildConfig.DEBUG)