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

Write automated tests: Android Basics with Compose - NoClassDefFoundError #240

Open
AlperenImam0glu opened this issue Oct 16, 2024 · 1 comment

Comments

@AlperenImam0glu
Copy link

AlperenImam0glu commented Oct 16, 2024

TipCalculatorTests, the unit test class we created by following the “Write automated tests” codelab, gives an error when run. The TipUITests class created for Ui testing runs smoothly. At first I thought there was a problem in my own steps, but there is the same error in the test_solution branch. I couldn't find a solution to this problem.

Error message:

java.lang.NoClassDefFoundError: com/example/tiptime/MainActivityKt

Repository
https://github.com/google-developer-training/basic-android-kotlin-compose-training-tip-calculator/tree/test_solution

@AJThePro99
Copy link

Yes! I've been getting this error as well. ( I actually created the test not under test/java at first )
I am on windows (Notorious for backslashes), and I went in to create directory test/java but the pre-determined option was not there (Spoiler: It was test\java) So, I went with the closest looking one: androidTest/java

And, I wrote the unit test as it is in the same, and it worked flawlessly. But, when I went to the next section of the codelab, turns out I messed up. So, I started from scratch and properly followed the codelab, only to run into NoClassDefFoundError

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