https://kotlinlang.org logo
#compose
Title
# compose
x

xxfast

01/13/2022, 11:00 AM
Hi all, trying to use
androidx.compose.material3:material3:1.0.0-alpha03
, and i’m running into this when building the app
Copy code
e: java.lang.IllegalArgumentException: Failed requirement.
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.visitNormalComposableCall(ComposableFunctionBodyTransformer.kt:2660)
Full trace in the thread. I’m using kotlin-1.6.10
full trace
Copy code
e: java.lang.IllegalArgumentException: Failed requirement.
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.visitNormalComposableCall(ComposableFunctionBodyTransformer.kt:2660)
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.visitComposableCall(ComposableFunctionBodyTransformer.kt:2617)
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.visitCall(ComposableFunctionBodyTransformer.kt:2573)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:199)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:24)
	at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:47)
	at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.kt:33)
	at org.jetbrains.kotlin.ir.expressions.IrExpressionBody.transformChildren(IrBody.kt:46)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBody(IrElementTransformerVoid.kt:108)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitExpressionBody(IrElementTransformerVoid.kt:114)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitExpressionBody(IrElementTransformerVoid.kt:115)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitExpressionBody(IrElementTransformerVoid.kt:24)
	at org.jetbrains.kotlin.ir.expressions.IrExpressionBody.accept(IrBody.kt:36)
	at org.jetbrains.kotlin.ir.expressions.IrExpressionBody.transform(IrBody.kt:39)
	at org.jetbrains.kotlin.ir.declarations.IrValueParameter.transformChildren(IrValueParameter.kt:56)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitDeclaration(IrElementTransformerVoid.kt:57)
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.visitDeclaration(ComposableFunctionBodyTransformer.kt:1784)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitValueParameter(IrElementTransformerVoid.kt:98)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitValueParameter(IrElementTransformerVoid.kt:99)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitValueParameter(IrElementTransformerVoid.kt:24)
	at org.jetbrains.kotlin.ir.declarations.IrValueParameter.transform(IrValueParameter.kt:49)
	at org.jetbrains.kotlin.ir.declarations.IrValueParameter.transform(IrValueParameter.kt:27)
	at org.jetbrains.kotlin.ir.util.TransformKt.transformIfNeeded(transform.kt:107)
	at org.jetbrains.kotlin.ir.declarations.IrFunction.transformChildren(IrFunction.kt:66)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitDeclaration(IrElementTransformerVoid.kt:57)
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.visitDeclaration(ComposableFunctionBodyTransformer.kt:1775)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFunction(IrElementTransformerVoid.kt:69)
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.visitFunctionInScope(ComposableFunctionBodyTransformer.kt:686)
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.visitFunction(ComposableFunctionBodyTransformer.kt:673)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:72)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:73)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:24)
	at org.jetbrains.kotlin.ir.declarations.IrSimpleFunction.accept(IrSimpleFunction.kt:28)
	at org.jetbrains.kotlin.ir.IrElement$DefaultImpls.transform(IrElement.kt:32)
	at org.jetbrains.kotlin.ir.IrElementBase.transform(IrElementBase.kt:19)
	at org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl.transformChildren(IrFileImpl.kt:89)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitPackageFragment(IrElementTransformerVoid.kt:41)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFile(IrElementTransformerVoid.kt:47)
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.visitFile(ComposableFunctionBodyTransformer.kt:1765)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFile(IrElementTransformerVoid.kt:48)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFile(IrElementTransformerVoid.kt:24)
	at org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl.accept(IrFileImpl.kt:81)
	at org.jetbrains.kotlin.ir.declarations.IrFile.transform(IrFile.kt:52)
	at org.jetbrains.kotlin.ir.declarations.impl.IrModuleFragmentImpl.transformChildren(IrModuleFragmentImpl.kt:45)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:330)
	at androidx.compose.compiler.plugins.kotlin.lower.ComposableFunctionBodyTransformer.lower(ComposableFunctionBodyTransformer.kt:462)
	at androidx.compose.compiler.plugins.kotlin.ComposeIrGenerationExtension.generate(ComposeIrGenerationExtension.kt:167)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr$lambda-1(JvmIrCodegenFactory.kt:121)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory$$Lambda$363/0x00000000027c3980.invoke(Unknown Source)
	at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment(Psi2IrTranslator.kt:88)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr(JvmIrCodegenFactory.kt:146)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr$default(JvmIrCodegenFactory.kt:64)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.generateModule(JvmIrCodegenFactory.kt:59)
	at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:35)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:331)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:123)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:58)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:170)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:434)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:120)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:357)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:299)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl$rebuild(IncrementalCompilerRunner.kt:118)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:169)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:80)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:622)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:100)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1713)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	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(AccessController.java:774)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$1200/0x0000000000000000.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:708)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:853)
my gradle kts looks like
Copy code
sourceSets {
val commonMain by getting {
  dependencies {
    ...
    implementation(compose.runtime)
    implementation(compose.foundation)
    implementation(compose.material)
    implementation(compose.uiTooling)
    ...
  }
}

val androidMain by getting {
  dependencies {
    ..
    implementation(AndroidX.Compose.material3) // "androidx.compose.material3:material3:1.0.0-alpha03"
  }
}
c

Colton Idle

01/13/2022, 5:45 PM
I'd file a bug. material3 (from when I tried to use it) had a lot of missing features and issues. I'm going to wait a little longer before I try to use it.
c

Chris Sinco [G]

01/13/2022, 8:29 PM
cc @Nick Rout
x

xxfast

01/13/2022, 9:20 PM
will create a minimal working example project
🙏 1
6 Views