google-developer-training / basic-android-kotlin-compose-training-cupcake

Apache License 2.0
71 stars 83 forks source link

TEST failure "Navigate between screens with Compose: Android Basics with Compose" #107

Open alejaacevedo02 opened 1 month ago

alejaacevedo02 commented 1 month ago

URL of codelab

In which task and step of the codelab can this issue be found? When creating the navigation test and trying to run it with my physical device or emulator I can't execute the tests.

Describe the problem This is the stacktrace of the failed test run : Unknown platform error occurred when running the UTP test suite. Please check logs for details. java.lang.NullPointerException at com.google.testing.platform.executor.SingleDeviceExecutor$execute$3.invoke(SingleDeviceExecutor.kt:101) at com.google.testing.platform.executor.SingleDeviceExecutor$execute$3.invoke(SingleDeviceExecutor.kt:100) at com.google.testing.platform.result.TestResultListenerManager.afterTestSuite(TestResultListenerManager.kt:139) at com.google.testing.platform.executor.SingleDeviceExecutor.execute(SingleDeviceExecutor.kt:115) at com.google.testing.platform.RunnerImpl.run(RunnerImpl.kt:117) at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy$run$5.invoke(NonInteractiveServerStrategy.kt:95) at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy$run$5.invoke(NonInteractiveServerStrategy.kt:94) at com.google.testing.platform.core.telemetry.common.noop.NoopDiagnosticsScope.recordEvent(NoopDiagnosticsScope.kt:35) at com.google.testing.platform.core.telemetry.TelemetryKt.recordEvent(Telemetry.kt:66) at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy.run(NonInteractiveServerStrategy.kt:94) at com.google.testing.platform.main.MainKt$main$4.invokeSuspend(Main.kt:75) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:279) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking(Builders.kt:59) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking$default(Builders.kt:38) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at com.google.testing.platform.main.MainKt.main(Main.kt:73) at com.google.testing.platform.main.MainKt.main$default(Main.kt:35) at com.google.testing.platform.main.MainKt.main(Main.kt) 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 com.google.testing.platform.launcher.Launcher.main(Launcher.java:149)

The only Solution I found was to use the following in gradle.properties : "android.experimental.androidTest.useUnifiedTestPlatform=false" however this is set to be deprecated as from gradle 9.0 so what is the real solution to this problem?

Steps to reproduce?

  1. Go to... CupcakeScreenNavigationTest.kt
  2. Click on... Run CupacakeScreeNavigationTest.kt
  3. See error... see the error I posted above in the failed gradle task

Versions Android Studio version: Android Studio Koala 2024.1.1 Patch 1 API version of the emulator: Device Google Pixel 7

Additional information Include screenshots if they would be useful in clarifying the problem.