I'm running to an annoying problem in one of my android studio project, this gradle problem is intermitten, I can't tell which part of my code caused this. just wondering if someone ran into this problem and found solution
the error will be gone after I clean/rebuild my project, but then it will happen again in the next hours/days.
Task :feature:profile:compileDebugKotlin
e: java.lang.StackOverflowError
at org.jetbrains.kotlin.com.intellij.util.containers.BidirectionalMap.get(BidirectionalMap.java:86)
at org.jetbrains.kotlin.cfg.pseudocode.PseudocodeImpl.getElementValue(PseudocodeImpl.kt:187)
at org.jetbrains.kotlin.cfg.pseudocode.ControlFlowInstructionsGenerator$ControlFlowInstructionsGeneratorWorker.getBoundValue(ControlFlowInstructionsGenerator.kt:234)
at org.jetbrains.kotlin.cfg.ControlFlowBuilderAdapter.getBoundValue(ControlFlowBuilderAdapter.kt:204)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.getReceiverValues(ControlFlowProcessor.kt:1618)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.getReceiverValues(ControlFlowProcessor.kt:1589)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.generateCall(ControlFlowProcessor.kt:1535)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.checkAndGenerateCall(ControlFlowProcessor.kt:1528)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.generateCall(ControlFlowProcessor.kt:1523)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.visitBinaryExpression(ControlFlowProcessor.kt:349)
at org.jetbrains.kotlin.psi.KtVisitorVoid.visitBinaryExpression(KtVisitorVoid.java:713)
at org.jetbrains.kotlin.psi.KtVisitorVoid.visitBinaryExpression(KtVisitorVoid.java:21)
at org.jetbrains.kotlin.psi.KtBinaryExpression.accept(KtBinaryExpression.java:35)
at org.jetbrains.kotlin.psi.KtElementImpl.accept(KtElementImpl.java:49)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.generateInstructions(ControlFlowProcessor.kt:179)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.getReceiverValues(ControlFlowProcessor.kt:1619)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.getReceiverValues(ControlFlowProcessor.kt:1589)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.generateCall(ControlFlowProcessor.kt:1535)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.checkAndGenerateCall(ControlFlowProcessor.kt:1528)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.generateCall(ControlFlowProcessor.kt:1523)
at org.jetbrains.kotlin.cfg.ControlFlowProcessor$CFPVisitor.visitBinaryExpression(ControlFlowProcessor.kt:349)
at org.jetbrains.kotlin.psi.KtVisitorVoid.visitBinaryExpression(KtVisitorVoid.java:713)
at org.jetbrains.kotlin.psi.KtVisitorVoid.visitBinaryExpression(KtVisitorVoid.java:21)
the rootcause printed in the stacktrace is also keep changing each time, in the example its BidirectionalMap, another time it will be different.
the error not only happen in my local machine, I tried running it in my friend's machine but it's the same. the real problem is I cannot perform CI/CD using AppCenter anymore because of this.