4

I am unable to build my release product if I include kotlin-reflect with it. I attempted adding this to proguard configuration:

-keep class kotlin.reflect.** { *; }

But it did not help at all. Here is the error result from the gradle build:

Optimizing...
Unexpected error while performing partial evaluation:
   Class       = [kotlin/reflect/jvm/internal/impl/renderer/DescriptorRendererImpl]
   Method      = [renderPossiblyInnerType(Ljava/lang/StringBuilder;Lkotlin/reflect/jvm/internal/impl/descriptors/PossiblyInnerType;)V]
   Exception   = [java.lang.IllegalArgumentException] (Stacks have different current sizes [0] and [1])
 Warning: Exception while processing task java.io.IOException: java.lang.IllegalArgumentException: Stacks have different current sizes [0] and [1]

I am using kotlin 1.1.1 (and gradle 3.3, if that matters.) j

David Pisoni
  • 3,317
  • 2
  • 25
  • 35

1 Answers1

0

I had some similar errors with kotlin reflect class and proguard, solved adding in the -optimizations

!class/unboxing/enum

My bug was related to this Android Proguard failing with "Value 'i' is not a reference value" and found the fix in one of the comments

Ignacio Tomas Crespo
  • 3,401
  • 1
  • 20
  • 13