RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 405 forks source link

Stack size becomes negative after instruction [163] pop #223

Closed smelfungus closed 6 years ago

smelfungus commented 6 years ago

Hi there! Thank you for such a great library. Seems like kotlinx.coroutines.experimental features are used and I'm afraid they're failing to compile under some circumstances with ProGuard usage.

Optimizing (pass 1/7)...
Unexpected error while computing stack sizes:
  Class       = [kotlinx/coroutines/experimental/JobSupport]
  Method      = [notifyCompletion(Lkotlinx/coroutines/experimental/JobSupport$NodeList;Ljava/lang/Throwable;)V]
  Exception   = [java.lang.IllegalArgumentException] (Stack size becomes negative after instruction [163] pop in [kotlinx/coroutines/experimental/JobSupport.notifyCompletion(Lkotlinx/coroutines/experimental/JobSupport$NodeList;Ljava/lang/Throwable;)V])
Warning: Exception while processing task java.io.IOException: java.lang.IllegalArgumentException: Stack size becomes negative after instruction [163] pop in [kotlinx/coroutines/experimental/JobSupport.notifyCompletion(Lkotlinx/coroutines/experimental/JobSupport$NodeList;Ljava/lang/Throwable;)V]

Related issues: https://github.com/Kotlin/kotlinx.coroutines/issues/247 https://sourceforge.net/p/proguard/bugs/689/ I'm also afraid that ProGuard 6.0.1 is not resolving that issues as far as I can test it. Will notify ProGuard maintainer too. Maybe someone is facing similar issues and has some temporary workarounds to suggest? I know that's not strongly related to Fotoapparat library itself but anyway as a side effect. Thank you!

smelfungus commented 6 years ago

Oh, seems like ProGuard 6.0.1 is resolving it. To temporary force dependency version:

buildscript {
    configurations.all {
        resolutionStrategy {
            force 'net.sf.proguard:proguard-gradle:6.0.1'
        }
    }
}

Closing for now.