Hi. From few days ago(seem that after updated Android Google-Play--Service 9.0.0)
below error occured when using '-optimizationpasses 1' (only 0 is okay.)
[Environment]
Android Studio 2.1.1
Proguard 5.2.1
Google Play Service SDK rev. 30.
Google Repositiry SDK rev 26.
[Error is ]
Printing usage to [xxxxxxxxxxxxxxxxxxxx\outputs\mapping\release\usage.txt]...
Removing unused program classes and class elements...
Original number of program classes: 6300
Final number of program classes: 4885
Optimizing...
Unexpected error while evaluating instruction:
Class = [com/google/firebase/iid/zzg]
Method = [zzeC(Ljava/lang/String;)V]
Instruction = [11] invokevirtual #49
Exception = [java.lang.ArrayIndexOutOfBoundsException] (1)
Unexpected error while performing partial evaluation:
Class = [com/google/firebase/iid/zzg]
Method = [zzeC(Ljava/lang/String;)V]
Exception = [java.lang.ArrayIndexOutOfBoundsException] (1)
Warning: Exception while processing task java.io.IOException: java.lang.ArrayIndexOutOfBoundsException: 1
:MNKeyboard_4GAPP:transformClassesAndResourcesWithProguardForRelease FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':MNKeyboard_4GAPP:transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: java.lang.ArrayIndexOutOfBoundsException: 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[config option]
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/,!class/merging/
-optimizationpasses 1
-allowaccessmodification
-dontpreverify
-keep class com.google.android.gms. { *; }
-dontwarn com.google.android.gms.
-dontwarn com.google.android.gms.auth.GoogleAuthUtil
-keep class com.google.firebase. { *; }
-dontwarn com.google.firebase.
Would you please fix the issue soon? possible?
[Add the missing options.]
-dontskipnonpubliclibraryclasses
-verbose
Hey. found/assume the cause of the error and solution somehow.
Situation is that
solution as workaround is that (in this case) add below options
-keep class android.support.v4.app. { *; }
-keep class android.support.v7.app. { ; }
-keep class android.support.v13.app. { ; }
-keep interface android.support.v4.app. { *; }
-keep interface android.support.v7.app. { ; }
-keep interface android.support.v13.app. { ; }
-dontwarn android.support.v4.
-dontwarn android.support.v7.
-dontwarn android.support.v13.**
.
Now. question is that
this can be solved by Proguard fix or suspected library fix?
Who can fix the issue?Proguard provider? or google?
Thanks for your report. I can't reproduce the problem yet. Which stack trace do you get if your run Gradle with the option --stacktrace ? Do you have a small sample project that illustrates the issue?
I have the same error and here is the stacktrace: