Closed personshelldon closed 4 years ago
+1 to this, just faced the issue while upgrading from 1.3.5 to 1.3.7.
1.3.6 works fine for me. I get the error on 1.3.7
+1. From 1.3.5 to 1.3.7, same issue
Unfortunately, this is a bug in Kotlin compiler related to function with contracts that were added in #2030.
We are working on the fix, a workaround is to extract withContext
calls from catch
blocks (I'll try to post more specific workaround later) to separate functions.
Also, it is fixed in 1.4-M2 compiler: https://youtrack.jetbrains.com/issue/KT-39298
This still is an issue in 1.3.8
They said it is a compiler bug, not a bug in this library.
Fixed in 1.3.9 with Kotlin 1.4
> Task :app:compileDebugKotlin
e: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: wrong bytecode generated
@Lorg/jetbrains/annotations/Nullable;() // invisible
// annotable parameter count: 1 (visible)
// annotable parameter count: 1 (invisible)
@Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 0
L0
L1
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.p$ : Lkotlinx/coroutines/CoroutineScope;
ASTORE 2
L2
L3
LINENUMBER 820 L3
ICONST_0
ISTORE 3
BIPUSH 100
ISTORE 4
L4
ILOAD 3
ILOAD 4
IF_ICMPGT L5
L6
L7
LINENUMBER 821 L7
LDC 10
ALOAD 0
ALOAD 0
ALOAD 2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
ALOAD 0
ILOAD 3
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ALOAD 0
ILOAD 4
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ALOAD 0
ICONST_1
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
INVOKESTATIC kotlinx/coroutines/DelayKt.delay (JLkotlin/coroutines/Continuation;)Ljava/lang/Object;
L8
DUP
ALOAD 5
IF_ACMPNE L9
L10
LINENUMBER 819 L10
ALOAD 5
ARETURN
L11
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ISTORE 4
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ISTORE 3
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
CHECKCAST kotlinx/coroutines/CoroutineScope
ASTORE 2
L12
NOP
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
ALOAD 1
L9
LINENUMBER 822 L9
POP
e: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: wrong bytecode generated
NOP
L13
INVOKESTATIC kotlinx/coroutines/Dispatchers.getMain ()Lkotlinx/coroutines/MainCoroutineDispatcher;
CHECKCAST kotlin/coroutines/CoroutineContext
NEW com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1$1
DUP
ALOAD 0
ALOAD 3
ACONST_NULL
INVOKESPECIAL com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1$1.<init> (Lcom/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1;Lkotlin/jvm/internal/Ref$IntRef;Lkotlin/coroutines/Continuation;)V
CHECKCAST kotlin/jvm/functions/Function2
ALOAD 0
ALOAD 0
ALOAD 2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
ALOAD 0
ILOAD 3
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ALOAD 0
ILOAD 4
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ALOAD 0
ICONST_2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
INVOKESTATIC kotlinx/coroutines/BuildersKt.withContext (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
L14
DUP
ALOAD 5
IF_ACMPNE L15
L16
LINENUMBER 819 L16
ALOAD 5
ARETURN
L17
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ISTORE 4
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ISTORE 3
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
CHECKCAST kotlinx/coroutines/CoroutineScope
ASTORE 2
L18
NOP
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
ALOAD 1
L15
LINENUMBER 820 L15
POP
NOP
L19
L20
L21
IINC 3 1
L22
GOTO L4
L5
L23
L24
LINENUMBER 826 L24
GETSTATIC kotlin/Unit.INSTANCE : Lkotlin/Unit;
ARETURN
L25
L26
L27
NEW java/lang/IllegalStateException
DUP
LDC "call to 'resume' before 'invoke' with coroutine"
INVOKESPECIAL java/lang/IllegalStateException.<init> (Ljava/lang/String;)V
ATHROW
RETURN
L28
LOCALVARIABLE $this$launch Lkotlinx/coroutines/CoroutineScope; L2 L26 2
LOCALVARIABLE i I L6 L22 3
LOCALVARIABLE this Lcom/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1; L0 L25 0
LOCALVARIABLE $result Ljava/lang/Object; L0 L25 1
MAXSTACK = 6
MAXLOCALS = 5
File being compiled: (819,51) in /home/sagar/Aspire/Aspire-Android/app/src/main/java/com/letsaspire/android/payment/application/view/PaymentFragment.kt
The root cause org.jetbrains.kotlin.codegen.CompilationException was thrown at: org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.kt:92)
at org.jetbrains.kotlin.codegen.FunctionCodegen.endVisit(FunctionCodegen.java:936)
at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethodBody(FunctionCodegen.java:493)
at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:261)
at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:177)
at org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenForLambda.generateResumeImpl(CoroutineCodegen.kt:464)
at org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenForLambda.generateClosureBody(CoroutineCodegen.kt:239)
at org.jetbrains.kotlin.codegen.ClosureCodegen.generateBody(ClosureCodegen.java:169)
at org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenForLambda.generateBody(CoroutineCodegen.kt:247)
at org.jetbrains.kotlin.codegen.MemberCodegen.generate(MemberCodegen.java:129)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.genClosure(ExpressionCodegen.java:1038)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.genClosure(ExpressionCodegen.java:1008)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.visitLambdaExpression(ExpressionCodegen.java:999)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.visitLambdaExpression(ExpressionCodegen.java:112)
at org.jetbrains.kotlin.psi.KtLambdaExpression.accept(KtLambdaExpression.java:40)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.genQualified(ExpressionCodegen.java:304)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.genQualified(ExpressionCodegen.java:286)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.gen(ExpressionCodegen.java:358)
at org.jetbrains.kotlin.codegen.CallGenerator$DefaultCallGenerator.genValueAndPut(CallGenerator.kt:70)
at org.jetbrains.kotlin.codegen.CallBasedArgumentGenerator.generateExpression(CallBasedArgumentGenerator.kt:42)
at org.jetbrains.kotlin.codegen.ArgumentGenerator.generate(ArgumentGenerator.kt:68)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2534)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2506)
at org.jetbrains.kotlin.codegen.Callable$invokeMethodWithArguments$1.invoke(Callable.kt:41)
at org.jetbrains.kotlin.codegen.Callable$invokeMethodWithArguments$1.invoke(Callable.kt:13)
at org.jetbrains.kotlin.codegen.OperationStackValue.putSelector(StackValue.kt:79)
at org.jetbrains.kotlin.codegen.StackValue.put(StackValue.java:122)
at org.jetbrains.kotlin.codegen.StackValue.put(StackValue.java:115)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.generateBlock(ExpressionCodegen.java:1282)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.generateBlock(ExpressionCodegen.java:1223)
at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitBlockExpression(CodegenStatementVisitor.java:56)
at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitBlockExpression(CodegenStatementVisitor.java:22)
at org.jetbrains.kotlin.psi.KtBlockExpression.accept(KtBlockExpression.java:78)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.genQualified(ExpressionCodegen.java:304)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.genStatement(ExpressionCodegen.java:409)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.gen(ExpressionCodegen.java:366)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.lambda$generateIfExpression$0(ExpressionCodegen.java:538)
at org.jetbrains.kotlin.codegen.OperationStackValue.putSelector(StackValue.kt:79)
at org.jetbrains.kotlin.codegen.StackValueWithLeaveTask.putSelector(StackValue.kt:67)
at org.jetbrains.kotlin.codegen.StackValue.put(StackValue.java:122)
at org.jetbrains.kotlin.codegen.StackValue.put(StackValue.java:115)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.putStackValue(ExpressionCodegen.java:386)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.gen(ExpressionCodegen.java:367)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.returnExpression(ExpressionCodegen.java:1731)
at org.jetbrains.kotlin.codegen.FunctionGenerationStrategy$FunctionDefault.doGenerateBody(FunctionGenerationStrategy.java:64)
at org.jetbrains.kotlin.codegen.FunctionGenerationStrategy$CodegenBased.generateBody(FunctionGenerationStrategy.java:84)
at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethodBody(FunctionCodegen.java:654)
at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethodBody(FunctionCodegen.java:479)
at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:261)
at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:177)
at org.jetbrains.kotlin.codegen.FunctionCodegen.gen(FunctionCodegen.java:148)
at org.jetbrains.kotlin.codegen.MemberCodegen.genSimpleMember(MemberCodegen.java:197)
at org.jetbrains.kotlin.codegen.ClassBodyCodegen.generateDeclaration(ClassBodyCodegen.java:166)
at org.jetbrains.kotlin.codegen.ClassBodyCodegen.generateBody(ClassBodyCodegen.java:86)
at org.jetbrains.kotlin.codegen.MemberCodegen.generate(MemberCodegen.java:129)
at org.jetbrains.kotlin.codegen.MemberCodegen.genClassOrObject(MemberCodegen.java:302)
at org.jetbrains.kotlin.codegen.MemberCodegen.genClassOrObject(MemberCodegen.java:286)
at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generateClassesAndObjectsInFile(PackageCodegenImpl.java:115)
at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generateFile(PackageCodegenImpl.java:134)
at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generate(PackageCodegenImpl.java:70)
at org.jetbrains.kotlin.codegen.DefaultCodegenFactory.generatePackage(CodegenFactory.kt:88)
at org.jetbrains.kotlin.codegen.DefaultCodegenFactory.generateModule(CodegenFactory.kt:67)
at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:35)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:634)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:194)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:163)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:51)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:85)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:105)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:349)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:105)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:237)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.access$compileIncrementally(IncrementalCompilerRunner.kt:37)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner$compile$2.invoke(IncrementalCompilerRunner.kt:79)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:91)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:606)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:99)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1645)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't transform method node:
invokeSuspend (Ljava/lang/Object;)Ljava/lang/Object;:
@Lorg/jetbrains/annotations/Nullable;() // invisible
// annotable parameter count: 1 (visible)
// annotable parameter count: 1 (invisible)
@Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 0
L0
L1
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.p$ : Lkotlinx/coroutines/CoroutineScope;
ASTORE 2
L2
L3
LINENUMBER 820 L3
ICONST_0
ISTORE 3
BIPUSH 100
ISTORE 4
L4
ILOAD 3
ILOAD 4
IF_ICMPGT L5
L6
L7
LINENUMBER 821 L7
LDC 10
ALOAD 0
ALOAD 0
ALOAD 2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
ALOAD 0
ILOAD 3
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ALOAD 0
ILOAD 4
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ALOAD 0
Caused by: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't transform method node:
ICONST_1
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
INVOKESTATIC kotlinx/coroutines/DelayKt.delay (JLkotlin/coroutines/Continuation;)Ljava/lang/Object;
L8
DUP
ALOAD 5
IF_ACMPNE L9
L10
LINENUMBER 819 L10
ALOAD 5
ARETURN
L11
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ISTORE 4
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ISTORE 3
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
CHECKCAST kotlinx/coroutines/CoroutineScope
ASTORE 2
L12
NOP
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
ALOAD 1
L9
LINENUMBER 822 L9
POP
NOP
L13
INVOKESTATIC kotlinx/coroutines/Dispatchers.getMain ()Lkotlinx/coroutines/MainCoroutineDispatcher;
CHECKCAST kotlin/coroutines/CoroutineContext
NEW com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1$1
DUP
ALOAD 0
ALOAD 3
ACONST_NULL
INVOKESPECIAL com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1$1.<init> (Lcom/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1;Lkotlin/jvm/internal/Ref$IntRef;Lkotlin/coroutines/Continuation;)V
CHECKCAST kotlin/jvm/functions/Function2
ALOAD 0
ALOAD 0
ALOAD 2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
ALOAD 0
ILOAD 3
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ALOAD 0
ILOAD 4
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ALOAD 0
ICONST_2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
INVOKESTATIC kotlinx/coroutines/BuildersKt.withContext (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
L14
DUP
ALOAD 5
IF_ACMPNE L15
L16
LINENUMBER 819 L16
ALOAD 5
ARETURN
L17
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ISTORE 4
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ISTORE 3
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
CHECKCAST kotlinx/coroutines/CoroutineScope
ASTORE 2
L18
NOP
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
ALOAD 1
L15
LINENUMBER 820 L15
POP
NOP
L19
L20
L21
IINC 3 1
L22
GOTO L4
L5
L23
L24
LINENUMBER 826 L24
GETSTATIC kotlin/Unit.INSTANCE : Lkotlin/Unit;
ARETURN
L25
L26
L27
NEW java/lang/IllegalStateException
DUP
LDC "call to 'resume' before 'invoke' with coroutine"
INVOKESPECIAL java/lang/IllegalStateException.<init> (Ljava/lang/String;)V
ATHROW
RETURN
L28
LOCALVARIABLE $this$launch Lkotlinx/coroutines/CoroutineScope; L2 L26 2
LOCALVARIABLE i I L6 L22 3
LOCALVARIABLE this Lcom/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1; L0 L25 0
LOCALVARIABLE $result Ljava/lang/Object; L0 L25 1
MAXSTACK = 6
MAXLOCALS = 5
File is unknown
The root cause org.jetbrains.kotlin.codegen.CompilationException was thrown at: org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.kt:92)
at org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.kt:92)
at org.jetbrains.kotlin.codegen.FunctionCodegen.endVisit(FunctionCodegen.java:929)
... 94 more
Caused by: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't transform method node:
invokeSuspend (Ljava/lang/Object;)Ljava/lang/Object;:
@Lorg/jetbrains/annotations/Nullable;() // invisible
// annotable parameter count: 1 (visible)
// annotable parameter count: 1 (invisible)
@Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 0
L0
INVOKESTATIC kotlin/coroutines/intrinsics/IntrinsicsKt.getCOROUTINE_SUSPENDED ()Ljava/lang/Object;
L1
LINENUMBER 819 L1
ASTORE 5
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
TABLESWITCH
0: L2
1: L3
2: L4
default: L5
L2
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
L6
L7
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.p$ : Lkotlinx/coroutines/CoroutineScope;
ASTORE 2
L8
L9
LINENUMBER 820 L9
ICONST_0
ISTORE 3
BIPUSH 100
ISTORE 4
L10
ILOAD 3
ILOAD 4
IF_ICMPGT L11
L12
L13
LINENUMBER 821 L13
LDC 10
ALOAD 0
ALOAD 0
ALOAD 2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
ALOAD 0
ILOAD 3
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ALOAD 0
ILOAD 4
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ALOAD 0
ICONST_1
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
INVOKESTATIC kotlinx/coroutines/DelayKt.delay (JLkotlin/coroutines/Continuation;)Ljava/lang/Object;
L14
DUP
ALOAD 5
IF_ACMPNE L15
L16
LINENUMBER 819 L16
ALOAD 5
ARETURN
L17
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ISTORE 4
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ISTORE 3
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
CHECKCAST kotlinx/coroutines/CoroutineScope
ASTORE 2
L18
NOP
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
ALOAD 1
L15
LINENUMBER 822 L15
POP
NOP
L19
INVOKESTATIC kotlinx/coroutines/Dispatchers.getMain ()Lkotlinx/coroutines/MainCoroutineDispatcher;
CHECKCAST kotlin/coroutines/CoroutineContext
NEW com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1$1
DUP
ALOAD 0
ALOAD 3
ACONST_NULL
INVOKESPECIAL com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1$1.<init> (Lcom/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1;Lkotlin/jvm/internal/Ref$IntRef;Lkotlin/coroutines/Continuation;)V
CHECKCAST kotlin/jvm/functions/Function2
ALOAD 0
ALOAD 0
ALOAD 2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
ALOAD 0
ILOAD 3
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ALOAD 0
ILOAD 4
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ALOAD 0
ICONST_2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
INVOKESTATIC kotlinx/coroutines/BuildersKt.withContext (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
L20
DUP
ALOAD 5
IF_ACMPNE L21
L22
LINENUMBER 819 L22
ALOAD 5
ARETURN
L23
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ISTORE 4
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ISTORE 3
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
CHECKCAST kotlinx/coroutines/CoroutineScope
ASTORE 2
L24
NOP
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
ALOAD 1
L21
LINENUMBER 820 L21
POP
NOP
L25
L26
L27
IINC 3 1
L28
GOTO L10
L11
L29
L30
LINENUMBER 826 L30
GETSTATIC kotlin/Unit.INSTANCE : Lkotlin/Unit;
ARETURN
L31
L32
L5
NEW java/lang/IllegalStateException
DUP
LDC "call to 'resume' before 'invoke' with coroutine"
INVOKESPECIAL java/lang/IllegalStateException.<init> (Ljava/lang/String;)V
ATHROW
RETURN
L33
LOCALVARIABLE $this$launch Lkotlinx/coroutines/CoroutineScope; L8 L32 2
LOCALVARIABLE i I L12 L28 3
LOCALVARIABLE this Lcom/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1; L0 L33 0
LOCALVARIABLE $result Ljava/lang/Object; L0 L33 1
MAXSTACK = 6
MAXLOCALS = 6
File is unknown
The root cause org.jetbrains.kotlin.codegen.CompilationException was thrown at: org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.kt:92)
at org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.kt:92)
at org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.kt:90)
... 95 more
Caused by: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't transform method node:
invokeSuspend (Ljava/lang/Object;)Ljava/lang/Object;:
@Lorg/jetbrains/annotations/Nullable;() // invisible
// annotable parameter count: 1 (visible)
// annotable parameter count: 1 (invisible)
@Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 0
L0
INVOKESTATIC kotlin/coroutines/intrinsics/IntrinsicsKt.getCOROUTINE_SUSPENDED ()Ljava/lang/Object;
L1
LINENUMBER 819 L1
ASTORE 5
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
TABLESWITCH
0: L2
1: L3
2: L4
default: L5
L2
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
L6
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.p$ : Lkotlinx/coroutines/CoroutineScope;
ASTORE 2
L7
LINENUMBER 820 L7
ICONST_0
ISTORE 3
BIPUSH 100
ISTORE 4
L8
ILOAD 3
ILOAD 4
IF_ICMPGT L9
L10
LINENUMBER 821 L10
LDC 10
ALOAD 0
ALOAD 0
ALOAD 2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
ALOAD 0
ILOAD 3
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ALOAD 0
ILOAD 4
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ALOAD 0
ICONST_1
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
INVOKESTATIC kotlinx/coroutines/DelayKt.delay (JLkotlin/coroutines/Continuation;)Ljava/lang/Object;
L11
DUP
ALOAD 5
IF_ACMPNE L12
L13
LINENUMBER 819 L13
ALOAD 5
ARETURN
L3
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ISTORE 4
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ISTORE 3
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
CHECKCAST kotlinx/coroutines/CoroutineScope
ASTORE 2
L14
NOP
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
ALOAD 1
L12
LINENUMBER 822 L12
POP
NOP
L15
INVOKESTATIC kotlinx/coroutines/Dispatchers.getMain ()Lkotlinx/coroutines/MainCoroutineDispatcher;
CHECKCAST kotlin/coroutines/CoroutineContext
NEW com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1$1
DUP
ALOAD 0
ALOAD 3
ACONST_NULL
INVOKESPECIAL com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1$1.<init> (Lcom/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1;Lkotlin/jvm/internal/Ref$IntRef;Lkotlin/coroutines/Continuation;)V
CHECKCAST kotlin/jvm/functions/Function2
ALOAD 0
ALOAD 0
ALOAD 2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
ALOAD 0
ILOAD 3
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ALOAD 0
ILOAD 4
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ALOAD 0
ICONST_2
PUTFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.label : I
INVOKESTATIC kotlinx/coroutines/BuildersKt.withContext (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
L16
DUP
ALOAD 5
IF_ACMPNE L17
L18
LINENUMBER 819 L18
ALOAD 5
ARETURN
L4
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$1 : I
ISTORE 4
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.I$0 : I
ISTORE 3
ALOAD 0
GETFIELD com/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1.L$0 : Ljava/lang/Object;
CHECKCAST kotlinx/coroutines/CoroutineScope
ASTORE 2
L19
NOP
ALOAD 1
INVOKESTATIC kotlin/ResultKt.throwOnFailure (Ljava/lang/Object;)V
ALOAD 1
L17
LINENUMBER 820 L17
POP
NOP
L20
IINC 3 1
L21
GOTO L8
L9
LINENUMBER 826 L9
GETSTATIC kotlin/Unit.INSTANCE : Lkotlin/Unit;
ARETURN
L5
NEW java/lang/IllegalStateException
DUP
LDC "call to 'resume' before 'invoke' with coroutine"
INVOKESPECIAL java/lang/IllegalStateException.<init> (Ljava/lang/String;)V
ATHROW
RETURN
L22
LOCALVARIABLE $this$launch Lkotlinx/coroutines/CoroutineScope; L7 L5 2
LOCALVARIABLE i I L10 L21 3
LOCALVARIABLE this Lcom/letsaspire/android/payment/application/view/PaymentFragment$checkPaymentResponse$1; L0 L22 0
LOCALVARIABLE $result Ljava/lang/Object; L0 L22 1
MAXSTACK = 6
MAXLOCALS = 6
File is unknown
The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.codegen.optimization.MethodVerifier.transform(MethodVerifier.kt:28)
at org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.kt:92)
at org.jetbrains.org.objectweb.asm.MethodVisitor.visitEnd(MethodVisitor.java:778)
at org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.kt:90)
... 96 more
Caused by: java.lang.AssertionError: AFTER mandatory stack transformations: incorrect bytecode
at org.jetbrains.kotlin.codegen.optimization.MethodVerifier.transform(MethodVerifier.kt:28)
at org.jetbrains.kotlin.codegen.optimization.transformer.CompositeMethodTransformer.transform(CompositeMethodTransformer.kt:25)
at org.jetbrains.kotlin.codegen.optimization.OptimizationMethodVisitor.performTransformations(OptimizationMethodVisitor.kt:62)
at org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.kt:70)
... 98 more
Caused by: java.lang.RuntimeException: org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 76: Expected an object reference, but found I
at org.jetbrains.kotlin.codegen.optimization.transformer.MethodTransformer.runAnalyzer(MethodTransformer.java:34)
at org.jetbrains.kotlin.codegen.optimization.transformer.MethodTransformer.analyze(MethodTransformer.java:44)
at org.jetbrains.kotlin.codegen.optimization.MethodVerifier.transform(MethodVerifier.kt:26)
... 101 more
Caused by: org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 76: Expected an object reference, but found I
at org.jetbrains.org.objectweb.asm.tree.analysis.Analyzer.analyze(Analyzer.java:291)
at org.jetbrains.kotlin.codegen.optimization.transformer.MethodTransformer.runAnalyzer(MethodTransformer.java:31)
... 103 more
Caused by: org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException: Expected an object reference, but found I
at org.jetbrains.org.objectweb.asm.tree.analysis.BasicVerifier.copyOperation(BasicVerifier.java:90)
at org.jetbrains.org.objectweb.asm.tree.analysis.BasicVerifier.copyOperation(BasicVerifier.java:43)
at org.jetbrains.org.objectweb.asm.tree.analysis.Frame.execute(Frame.java:288)
at org.jetbrains.org.objectweb.asm.tree.analysis.Analyzer.analyze(Analyzer.java:187)
... 104 more
Caused by: java.lang.AssertionError: AFTER mandatory stack transformations: incorrect bytecode
Caused by: java.lang.RuntimeException: org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 76: Expected an object reference, but found I
Caused by: org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 76: Expected an object reference, but found I
Caused by: org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException: Expected an object reference, but found I
> Task :app:compileDebugKotlin FAILED
facing this error
facing this error
Facing same error, how to solve?
This is also happened in our CI
Hello! After migrating to version 1.3.7 there is an error raised in this piece of code:
Stack trace:
Solution that works for me is to move
runBlocking
call into separate function and call that function or to downgrade to version 1.3.6. But, I think, this is really a bug, because it can be reproduced only on version 1.3.7.Environment: