https://kotlinlang.org logo
a

Adriano Celentano

10/14/2020, 2:33 PM
Following the Codelab about state / Step 6 / TodoItemInput https://developer.android.com/codelabs/jetpack-compose-state#5 As soon as i paste this code from the lab
Copy code
@Composable
fun TodoItemInput(onItemComplete: (TodoItem) -> Unit) {
   // onItemComplete is an event will fire when an item is completed by the user
   Column {
       Row(Modifier
           .padding(horizontal = 16.dp)
           .padding(top = 16.dp)
       ) {
           TodoInputTextField(Modifier
               .weight(1f)
               .padding(end = 8.dp)
           )
           TodoEditButton(
               onClick = { /* todo */ },
               text = "Add",
               modifier = Modifier.align(Alignment.CenterVertically)
           )
       }
   }
}
my app does not compile anymore
Copy code
w: ATTENTION!
This build uses unsafe internal compiler arguments:

-XXLanguage:+NonParenthesizedAnnotationsOnFunctionalTypes

This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!

e: warnings found and -Werror specified
w: /Users/adrian/Workspace/Android/android-compose-codelabs-main/StateCodelab/start/src/main/java/com/codelabs/state/todo/TodoScreen.kt: (84, 19): Parameter 'onItemComplete' is never used

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':start:compileDebugKotlin'.
> Compilation error. See log for more details
s

Se7eN

10/14/2020, 4:08 PM
Looks like the warnings are being treated as errors. A simple workaround could be to fix the warning.
But you should probably dig into why this is happening. Could be a bug
a

Adriano Celentano

10/14/2020, 6:00 PM
yeah its wierd warnings are threated like errors, didnt find what settings caused this yet
s

Se7eN

10/15/2020, 6:32 AM
Tell me if you find something
n

nickbutcher

10/15/2020, 8:12 AM
We tend to turn on
allWarningsAsErrors
as it helps stop warnings creep into a project: https://github.com/googlecodelabs/android-compose-codelabs/blob/main/StateCodelab/start/build.gradle#L38 cc/ @Sean McQuillan [G]
👍 1
s

Sean McQuillan [G]

10/15/2020, 6:41 PM
Thanks for the ping! I'll update the code in the codelab – sorry this slipped in
a

Adriano Celentano

10/15/2020, 9:14 PM
Can’t even explain how i didnt see that 😅 thx for the update 🙏 really enjoyed the codelab 👌
👍 1
5 Views