New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException: Stacks have different current sizes [0] and [1] when building with ProGuard optimizations #235

Closed
cypressious opened this Issue Aug 23, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@cypressious
Contributor

cypressious commented Aug 23, 2016

Pulling this out of #206:

When building with Proguard optimizations on (getDefaultProguardFile('proguard-android-optimize.txt')), I get the following error:

java.lang.IllegalArgumentException: Stacks have different current sizes [0] and [1]
Unexpected error while performing partial evaluation:
Class = [org/jetbrains/anko/AsyncKt$doAsync$1]
Method = [invoke()Ljava/lang/Object;]
Exception = java.lang.IllegalArgumentException

This is also reported in https://youtrack.jetbrains.com/issue/KT-12866 and https://sourceforge.net/p/proguard/bugs/610/.

The problem lies in the usage of the elvis operator in the catch block in

exceptionHandler?.invoke(thr) ?: Unit

@yanex Although this is technically a ProGuard bug, would you consider rewriting the code without the elvis operator and releasing a bugfix build? In the meantime, we're not able to use ProGuard optimizations in our app.

@yanex yanex added this to the Anko 0.10 milestone May 3, 2017

@yanex

This comment has been minimized.

Show comment
Hide comment
@yanex

yanex May 3, 2017

Contributor

Will be fixed in 0.10.

Contributor

yanex commented May 3, 2017

Will be fixed in 0.10.

@dlazerka

This comment has been minimized.

Show comment
Hide comment
@dlazerka

dlazerka Jun 19, 2017

Not sure it it's the same problem, or a bug in Proguard:

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

Can be workarounded by using -dontoptimize Proguard option.

Proguard version 5.2.1
Kotlin version 1.1.2-4

dlazerka commented Jun 19, 2017

Not sure it it's the same problem, or a bug in Proguard:

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

Can be workarounded by using -dontoptimize Proguard option.

Proguard version 5.2.1
Kotlin version 1.1.2-4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment