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 #238

Open
DigKleppe opened this issue Oct 11, 2024 · 0 comments
Open

Write automated tests: Android Basics with Compose #238

DigKleppe opened this issue Oct 11, 2024 · 0 comments

Comments

@DigKleppe
Copy link

I get this error with the code from github:

/snap/android-studio/170/jbr/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/snap/android-studio/172/lib/idea_rt.jar=35165:/snap/android-studio/172/bin -Dfile.encoding=UTF-8 -classpath /snap/android-studio/172/lib/idea_rt.jar:/snap/android-studio/172/plugins/junit/lib/junit5-rt.jar:/snap/android-studio/172/plugins/junit/lib/junit-rt.jar:/home/dig/Android/Sdk/platforms/android-34/android.jar:/home/dig/Android/Sdk/platforms/android-34/data/res:/mnt/linuxData/projecten/Android/basic-android-kotlin-compose-training-tip-calculator/app/build/tmp/kotlin-classes/debugUnitTest:/mnt/linuxData/projecten/Android/basic-android-kotlin-compose-training-tip-calculator/app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/debug/processDebugResources/R.jar:/mnt/linuxData/projecten/Android/basic-android-kotlin-compose-training-tip-calculator/app/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes:/home/dig/.gradle/caches/8.9/transforms/68e7d92e4e07298020d9ca521b2d4cfd/transformed/ui-test-manifest-1.5.0/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/68e7d92e4e07298020d9ca521b2d4cfd/transformed/ui-test-manifest-1.5.0/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/68e7d92e4e07298020d9ca521b2d4cfd/transformed/ui-test-manifest-1.5.0/res:/home/dig/.gradle/caches/8.9/transforms/4f84be89b5f249272ee9d0bf6b86af1d/transformed/activity-1.8.0/res:/home/dig/.gradle/caches/8.9/transforms/4f84be89b5f249272ee9d0bf6b86af1d/transformed/activity-1.8.0/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/4f84be89b5f249272ee9d0bf6b86af1d/transformed/activity-1.8.0/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/d49209af83b432b803dabd16ab4f680b/transformed/core-1.12.0/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/d49209af83b432b803dabd16ab4f680b/transformed/core-1.12.0/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/d49209af83b432b803dabd16ab4f680b/transformed/core-1.12.0/res:/home/dig/.gradle/caches/8.9/transforms/d219c6f05f8bd7cc43bd3816c793a334/transformed/annotation-experimental-1.3.0/res:/home/dig/.gradle/caches/8.9/transforms/d219c6f05f8bd7cc43bd3816c793a334/transformed/annotation-experimental-1.3.0/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/d219c6f05f8bd7cc43bd3816c793a334/transformed/annotation-experimental-1.3.0/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/172798a0bfd6d9fcd3364dc91bfc80db/transformed/lifecycle-runtime-2.6.2/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/172798a0bfd6d9fcd3364dc91bfc80db/transformed/lifecycle-runtime-2.6.2/res:/home/dig/.gradle/caches/8.9/transforms/172798a0bfd6d9fcd3364dc91bfc80db/transformed/lifecycle-runtime-2.6.2/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/0a0e21e1a861929685b48b8841d5f30f/transformed/versionedparcelable-1.1.1/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/0a0e21e1a861929685b48b8841d5f30f/transformed/versionedparcelable-1.1.1/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/38acb72ba4a36e603b7d509b3e0dba28/transformed/lifecycle-viewmodel-2.6.2/res:/home/dig/.gradle/caches/8.9/transforms/38acb72ba4a36e603b7d509b3e0dba28/transformed/lifecycle-viewmodel-2.6.2/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/38acb72ba4a36e603b7d509b3e0dba28/transformed/lifecycle-viewmodel-2.6.2/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/9b375d683856a5e6cf8290ee71d04854/transformed/lifecycle-viewmodel-savedstate-2.6.2/res:/home/dig/.gradle/caches/8.9/transforms/9b375d683856a5e6cf8290ee71d04854/transformed/lifecycle-viewmodel-savedstate-2.6.2/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/9b375d683856a5e6cf8290ee71d04854/transformed/lifecycle-viewmodel-savedstate-2.6.2/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/7585db486924a248fbd5daad336c6087/transformed/core-ktx-1.12.0/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/7585db486924a248fbd5daad336c6087/transformed/core-ktx-1.12.0/res:/home/dig/.gradle/caches/8.9/transforms/7585db486924a248fbd5daad336c6087/transformed/core-ktx-1.12.0/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/831b0db58540cb7203cd5b0b4bfbbac7/transformed/lifecycle-livedata-core-2.6.2/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/831b0db58540cb7203cd5b0b4bfbbac7/transformed/lifecycle-livedata-core-2.6.2/res:/home/dig/.gradle/caches/8.9/transforms/831b0db58540cb7203cd5b0b4bfbbac7/transformed/lifecycle-livedata-core-2.6.2/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/9368e6801b8675904d89f142d5533540/transformed/savedstate-1.2.1/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/9368e6801b8675904d89f142d5533540/transformed/savedstate-1.2.1/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/9368e6801b8675904d89f142d5533540/transformed/savedstate-1.2.1/res:/home/dig/.gradle/caches/8.9/transforms/ff36ca9878e73f163ad07761afcd5274/transformed/activity-compose-1.8.0/res:/home/dig/.gradle/caches/8.9/transforms/ff36ca9878e73f163ad07761afcd5274/transformed/activity-compose-1.8.0/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/ff36ca9878e73f163ad07761afcd5274/transformed/activity-compose-1.8.0/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/233e40b9b8326827956c644c6b3c505d/transformed/activity-ktx-1.8.0/res:/home/dig/.gradle/caches/8.9/transforms/233e40b9b8326827956c644c6b3c505d/transformed/activity-ktx-1.8.0/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/233e40b9b8326827956c644c6b3c505d/transformed/activity-ktx-1.8.0/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/7111d019d1012915f46192096169992f/transformed/lifecycle-runtime-ktx-2.6.2/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/7111d019d1012915f46192096169992f/transformed/lifecycle-runtime-ktx-2.6.2/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/7111d019d1012915f46192096169992f/transformed/lifecycle-runtime-ktx-2.6.2/res:/home/dig/.gradle/caches/8.9/transforms/0cd24dc1a61f81d00eac82a417a24a09/transformed/lifecycle-viewmodel-ktx-2.6.2/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/0cd24dc1a61f81d00eac82a417a24a09/transformed/lifecycle-viewmodel-ktx-2.6.2/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/0cd24dc1a61f81d00eac82a417a24a09/transformed/lifecycle-viewmodel-ktx-2.6.2/res:/home/dig/.gradle/caches/8.9/transforms/fda20ae196c11dbcfed3985030268944/transformed/savedstate-ktx-1.2.1/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/fda20ae196c11dbcfed3985030268944/transformed/savedstate-ktx-1.2.1/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/fda20ae196c11dbcfed3985030268944/transformed/savedstate-ktx-1.2.1/res:/home/dig/.gradle/caches/8.9/transforms/9c055d7448fa08014536f2b8fc5cf793/transformed/runtime-release/res:/home/dig/.gradle/caches/8.9/transforms/9c055d7448fa08014536f2b8fc5cf793/transformed/runtime-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/9c055d7448fa08014536f2b8fc5cf793/transformed/runtime-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/ebcf95b79f8d50d37a496fd1a8bb7083/transformed/runtime-saveable-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/ebcf95b79f8d50d37a496fd1a8bb7083/transformed/runtime-saveable-release/res:/home/dig/.gradle/caches/8.9/transforms/ebcf95b79f8d50d37a496fd1a8bb7083/transformed/runtime-saveable-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/3e54cccbbe143e55f4f42994498d39cd/transformed/ui-release/res:/home/dig/.gradle/caches/8.9/transforms/3e54cccbbe143e55f4f42994498d39cd/transformed/ui-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/3e54cccbbe143e55f4f42994498d39cd/transformed/ui-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/22533f59a66e2af0193d5fac13fe7f03/transformed/ui-geometry-release/res:/home/dig/.gradle/caches/8.9/transforms/22533f59a66e2af0193d5fac13fe7f03/transformed/ui-geometry-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/22533f59a66e2af0193d5fac13fe7f03/transformed/ui-geometry-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/20213fa6a0837813f398d2414dadcb63/transformed/ui-graphics-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/20213fa6a0837813f398d2414dadcb63/transformed/ui-graphics-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/20213fa6a0837813f398d2414dadcb63/transformed/ui-graphics-release/res:/home/dig/.gradle/caches/8.9/transforms/281a24ac22a69f887a17d877646b3817/transformed/ui-unit-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/281a24ac22a69f887a17d877646b3817/transformed/ui-unit-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/281a24ac22a69f887a17d877646b3817/transformed/ui-unit-release/res:/home/dig/.gradle/caches/8.9/transforms/a81eb2570e95ac5deca18ebdc2a4d030/transformed/ui-text-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/a81eb2570e95ac5deca18ebdc2a4d030/transformed/ui-text-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/a81eb2570e95ac5deca18ebdc2a4d030/transformed/ui-text-release/res:/home/dig/.gradle/caches/8.9/transforms/d78dbc0a8e9e25330a4b54380f5c4a44/transformed/material3-1.1.1/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/d78dbc0a8e9e25330a4b54380f5c4a44/transformed/material3-1.1.1/res:/home/dig/.gradle/caches/8.9/transforms/d78dbc0a8e9e25330a4b54380f5c4a44/transformed/material3-1.1.1/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/e898b515391b9b583ed33c0c73beadd1/transformed/foundation-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/e898b515391b9b583ed33c0c73beadd1/transformed/foundation-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/e898b515391b9b583ed33c0c73beadd1/transformed/foundation-release/res:/home/dig/.gradle/caches/8.9/transforms/72a780afda65997ec2b71baf0cea9807/transformed/animation-release/res:/home/dig/.gradle/caches/8.9/transforms/72a780afda65997ec2b71baf0cea9807/transformed/animation-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/72a780afda65997ec2b71baf0cea9807/transformed/animation-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/1b267d5698097d3749085ded931606f5/transformed/animation-core-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/1b267d5698097d3749085ded931606f5/transformed/animation-core-release/res:/home/dig/.gradle/caches/8.9/transforms/1b267d5698097d3749085ded931606f5/transformed/animation-core-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/a8cfad81164909df25c9e9ad80eb4f81/transformed/foundation-layout-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/a8cfad81164909df25c9e9ad80eb4f81/transformed/foundation-layout-release/res:/home/dig/.gradle/caches/8.9/transforms/a8cfad81164909df25c9e9ad80eb4f81/transformed/foundation-layout-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/928c578fd35a0c541e2aeda6a8236835/transformed/material-icons-core-release/res:/home/dig/.gradle/caches/8.9/transforms/928c578fd35a0c541e2aeda6a8236835/transformed/material-icons-core-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/928c578fd35a0c541e2aeda6a8236835/transformed/material-icons-core-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/ec478e9e90e29cbfd8248ef6bd6615fb/transformed/material-ripple-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/ec478e9e90e29cbfd8248ef6bd6615fb/transformed/material-ripple-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/ec478e9e90e29cbfd8248ef6bd6615fb/transformed/material-ripple-release/res:/home/dig/.gradle/caches/8.9/transforms/d89fba876bb450762c8299c675131f9b/transformed/ui-tooling-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/d89fba876bb450762c8299c675131f9b/transformed/ui-tooling-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/d89fba876bb450762c8299c675131f9b/transformed/ui-tooling-release/res:/home/dig/.gradle/caches/8.9/transforms/42e93b0331d691d46e5965478d1401cf/transformed/ui-tooling-data-release/res:/home/dig/.gradle/caches/8.9/transforms/42e93b0331d691d46e5965478d1401cf/transformed/ui-tooling-data-release/AndroidManifest.xml:/home/dig/.gradle/caches/8.9/transforms/42e93b0331d691d46e5965478d1401cf/transformed/ui-tooling-data-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/be53e5c3b801e10be7216cb998ca33c2/transformed/ui-tooling-preview-release/res:/home/dig/.gradle/caches/8.9/transforms/be53e5c3b801e10be7216cb998ca33c2/transformed/ui-tooling-preview-release/jars/classes.jar:/home/dig/.gradle/caches/8.9/transforms/be53e5c3b801e10be7216cb998ca33c2/transformed/ui-tooling-preview-release/AndroidManifest.xml:/home/dig/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.9.10/c7510d64a83411a649c76f2778304ddf71d7437b/kotlin-stdlib-jdk8-1.9.10.jar:/home/dig/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar:/home/dig/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.9.10/dafaf2c27f27c09220cee312df10917d9a5d97ce/kotlin-stdlib-common-1.9.10.jar:/home/dig/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/home/dig/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.9.10/bc5bfc2690338defd5195b05c57562f2194eeb10/kotlin-stdlib-jdk7-1.9.10.jar:/home/dig/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation-jvm/1.6.0/a7257339a052df0f91433cf9651231bbb802b502/annotation-jvm-1.6.0.jar:/home/dig/.gradle/caches/modules-2/files-2.1/androidx.arch.core/core-common/2.2.0/5e1b8b81dfd5f52c56a8d53b18ca759c19a301f3/core-common-2.2.0.jar:/home/dig/.gradle/caches/modules-2/files-2.1/androidx.lifecycle/lifecycle-common/2.6.2/10f354fdb64868baecd67128560c5a0d6312c495/lifecycle-common-2.6.2.jar:/home/dig/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-android/1.6.4/f955fc8b2ad196e2f4429598440e15f7492eeb2b/kotlinx-coroutines-android-1.6.4.jar:/home/dig/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm/1.6.4/2c997cd1c0ef33f3e751d3831929aeff1390cb30/kotlinx-coroutines-core-jvm-1.6.4.jar:/home/dig/.gradle/caches/modules-2/files-2.1/androidx.collection/collection/1.1.0/1f27220b47669781457de0d600849a5de0e89909/collection-1.1.0.jar:/home/dig/.gradle/caches/modules-2/files-2.1/junit/junit/4.13.2/8ac9e16d933b6fb43bc7f576336b8f4d7eb5ba12/junit-4.13.2.jar:/home/dig/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.example.tiptime.TipCalculatorTests,calculateTip_20PercentNoRoundup

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

at com.example.tiptime.TipCalculatorTests.calculateTip_20PercentNoRoundup(TipCalculatorTests.kt:29)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)

Caused by: java.lang.ClassNotFoundException: com.example.tiptime.MainActivityKt
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 28 more

Process finished with exit code 255

Android Studio Ladybug | 2024.2.1
Build #AI-242.21829.142.2421.12409432, built on September 24, 2024
Runtime version: 21.0.3+-12282718-b509.11 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.X11.XToolkit
Linux 6.8.0-45-generic
Kotlin plugin: K2 mode (Beta)
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 16
Registry:
ide.experimental.ui=true
i18n.locale=
Current Desktop: ubuntu:GNOME

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

1 participant