Adriano Celentano

    Adriano Celentano

    1 year ago
    Following the Codelab about state / Step 6 / TodoItemInputhttps://developer.android.com/codelabs/jetpack-compose-state#5 As soon as i paste this code from the lab
    @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
    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

    1 year ago
    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
    Adriano Celentano

    Adriano Celentano

    1 year ago
    yeah its wierd warnings are threated like errors, didnt find what settings caused this yet
    s

    Se7eN

    1 year ago
    Tell me if you find something
    nickbutcher

    nickbutcher

    1 year ago
    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]
    Sean McQuillan [G]

    Sean McQuillan [G]

    1 year ago
    Thanks for the ping! I'll update the code in the codelab – sorry this slipped in
    Adriano Celentano

    Adriano Celentano

    1 year ago
    Can’t even explain how i didnt see that 😅 thx for the update 🙏 really enjoyed the codelab 👌