Kotlin error does not find bytecode for lambda Function: "Failed to find byte code for java/util/Function/Biconsumer"

Asked

Viewed 376 times

1

When I try to run my app on mobile (emulator happens the same), the following error occurs:

Error:FAILURE: Build failed with an exception.

* What went wrong: 
Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
> com.android.build.api.transform.TransformException: 
java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: 
Failed to find byte code for java/util/function/BiConsumer

* Try:
 Run with --stacktrace option to get the stack trace. Run with --info or --
 debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 4s

"Solutions" I have tried but not worked:

  • Update Android Studio (Canary 6),

  • Update Kotlin (1.2.10),

  • Update Gradle (3.1.0-alpha06),

  • Add Multidex dependency

  • I believe this is a problem with the Instant Run instead of with Kotlin. Turn off Instant Run in the settings.

  • It worked! But it’s strange, because on another PC it worked with Instant Run enabled...

  • The problem is that some emulators/devices do not have Instant Run support and this error happens.

1 answer

1

Try disabling Instant Run on

Preferences > Build, Execution, Deployment

Android Studio Preferences

It was the only thing that worked for me!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.