JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.26k stars 1.18k forks source link

MethodTooLargeException with huge icon pack #4285

Closed tipapro closed 9 months ago

tipapro commented 9 months ago

Describe the bug The build crashes despite fixed a similar bug https://github.com/JetBrains/compose-multiplatform/issues/4194

exception: exception: java.lang.RuntimeException: Error generating class file kotlinproject/composeapp/generated/resources/Res$drawable.class (compiled from [C:\Users\tipapro\Desktop\KotlinProject\composeApp\build\generated\compose\resourceGenerator\kotlin\kotlinproject\composeapp\generated\resources\Res.kt]): Method too large: kotlinproject/composeapp/generated/resources/Res$drawable.<clinit> ()V
exception:  at org.jetbrains.kotlin.codegen.ClassFileFactory$OutputClassFile.asByteArray(ClassFileFactory.java:310)
exception:  at org.jetbrains.kotlin.cli.common.output.OutputUtilsKt.writeAll(outputUtils.kt:33)
exception:  at org.jetbrains.kotlin.cli.common.output.OutputUtilsKt.writeAllTo(outputUtils.kt:47)
exception:  at org.jetbrains.kotlin.cli.common.output.OutputUtilsKt.writeAll(outputUtils.kt:52)
exception:  at org.jetbrains.kotlin.cli.jvm.compiler.CliCompilerUtilsKt.writeOutput(cliCompilerUtils.kt:134)
exception:  at org.jetbrains.kotlin.cli.jvm.compiler.CliCompilerUtilsKt$createOutputFilesFlushingCallbackIfPossible$1.invoke(cliCompilerUtils.kt:95)
exception:  at org.jetbrains.kotlin.cli.jvm.compiler.CliCompilerUtilsKt$createOutputFilesFlushingCallbackIfPossible$1.invoke(cliCompilerUtils.kt:93)
exception:  at org.jetbrains.kotlin.codegen.state.GenerationStateKt$GenerationStateEventCallback$1.invoke(GenerationState.kt:412)
exception:  at org.jetbrains.kotlin.codegen.state.GenerationStateKt$GenerationStateEventCallback$1.invoke(GenerationState.kt:411)
exception:  at org.jetbrains.kotlin.codegen.state.GenerationState.afterIndependentPart(GenerationState.kt:363)
exception:  at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.invokeCodegen(JvmIrCodegenFactory.kt:366)
exception:  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.runCodegen(KotlinToJVMBytecodeCompiler.kt:347)
exception:  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:122)
exception:  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:43)
exception:  at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:165)
exception:  at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:50)
exception:  at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:104)
exception:  at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:48)
exception:  at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
exception:  at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:79)
exception:  at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:43)
exception:  at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:180)
exception:  at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit$default(CLITool.kt:175)
exception:  at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:167)
exception:  at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:250)
exception:  at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)
exception: caused by: org.jetbrains.org.objectweb.asm.MethodTooLargeException: Method too large: kotlinproject/composeapp/generated/resources/Res$drawable.<clinit> ()V
exception:  at org.jetbrains.org.objectweb.asm.MethodWriter.computeMethodInfoSize(MethodWriter.java:2087)
exception:  at org.jetbrains.org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:489)
exception:  at org.jetbrains.kotlin.codegen.ClassBuilderFactories$2.asBytes(ClassBuilderFactories.java:118)
exception:  at org.jetbrains.kotlin.codegen.DelegatingClassBuilderFactory.asBytes(DelegatingClassBuilderFactory.kt:36)
exception:  at org.jetbrains.kotlin.codegen.DelegatingClassBuilderFactory.asBytes(DelegatingClassBuilderFactory.kt:36)
exception:  at org.jetbrains.kotlin.codegen.ClassFileFactory$ClassBuilderAndSourceFileList.asBytes(ClassFileFactory.java:343)
exception:  at org.jetbrains.kotlin.codegen.ClassFileFactory$OutputClassFile.asByteArray(ClassFileFactory.java:307)
exception:  ... 25 more
exception: 

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior:

  1. Create template KMP project
  2. Add all icons from there
terrakok commented 9 months ago
image
okushnikov commented 4 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.