Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an interactive Dice Roller app: Android Basics with Compose #128

Closed
knightafter opened this issue Mar 5, 2024 · 1 comment
Closed
Assignees

Comments

@knightafter
Copy link

URL of codelab

https://developer.android.com/codelabs/basic-android-kotlin-compose-build-a-dice-roller-app?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-build-a-dice-roller-app#7

In which task and step of the codelab can this issue be found?

The issue is in the different sections but specifically in the "Build the Dice-Roll Logic" whereas the is "result" that is used under the DiceWithButtonAndImage function in the repository code.

Describe the problem
The problem is with the "result" keyword in the DiceWithButtonAndImage function I don't know that may be its because of my new Android Studio version or what but as I took a help of Copoilot it tells that its the readabilty issue of the "result " keyword.

Steps to reproduce?

  1. Download the code from the repository and the error is in the IDE interface in the mainActivity file.
  2. Just click on the result it may give the error of mismatch type.
  3. If we replace the result keyword with any other easily definable keyword then the issue is resolved such as "rolledValue".

Versions
Android Studio version: 17.0.7+0-b2043.56-10550314 amd64
API version of the emulator: API 31

Additional information
Screenshot (1)

Screenshot (2)

@johnshea johnshea self-assigned this Mar 21, 2024
@johnshea
Copy link
Contributor

Hi @knightafter

Thank you for writing in.

The code in your first screenshot does not match the downloaded code.

You are missing the equal sign (=) after the variable result.

You have result(1..6).

Your second screenshots shows rolledValue = (1..6).

Hope that helps clarify it.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants