uds-se / droidmate

DroidMate-2: A Platform for Android Test Generation
http://www.boxmate.org/
GNU General Public License v3.0
28 stars 14 forks source link

ISSUE-2: KotlinNullPointerException during replay of a recorded test case #2

Closed mmilella94 closed 3 years ago

mmilella94 commented 5 years ago

I am using DM2 to perform capture and replay of automatically generated test cases. For certain applications, when replaying the recorded test cases, DM2 crashes with “kotlin.KotlinNullPointerException”

This happens for Version: 1.10 ( com.lubosmikusiak.articuli.derdiedas, downloaded from https://www.apkmonk.com/app/com.lubosmikusiak.articuli.derdiedas/ ).

This is the stack trace

16:38:45.014 [main] ERROR org.droidmate.command.ExploreCommand - kotlin.KotlinNullPointerException org.droidmate.device.android_sdk.ApkExplorationException: kotlin.KotlinNullPointerException at org.droidmate.tools.ApkDeployer.withDeployedApk(ApkDeployer.kt:66) at org.droidmate.tools.ApkDeployer$withDeployedApk$1.invokeSuspend(ApkDeployer.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32) at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:236) at kotlinx.coroutines.EventLoopBase.processNextEvent(EventLoop.kt:123) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:69) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking(Builders.kt:45) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking$default(Builders.kt:35) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1.invoke(ExploreCommand.kt:333) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1.invoke(ExploreCommand.kt:89) at org.droidmate.tools.AndroidDeviceDeployer.withSetupDevice(AndroidDeviceDeployer.kt:183) at org.droidmate.command.ExploreCommand.deployExploreSerialize(ExploreCommand.kt:332) at org.droidmate.command.ExploreCommand.execute(ExploreCommand.kt:314) at org.droidmate.command.ExploreCommand.execute(ExploreCommand.kt:240) at org.droidmate.frontend.DroidmateFrontend$Companion.execute(DroidmateFrontend.kt:131) at org.droidmate.frontend.DroidmateFrontend$Companion.execute$default(DroidmateFrontend.kt:97) at org.droidmate.frontend.DroidmateFrontend$Companion.main(DroidmateFrontend.kt:86) at org.droidmate.frontend.DroidmateFrontend.main(DroidmateFrontend.kt) Caused by: kotlin.KotlinNullPointerException at org.droidmate.exploration.strategy.playback.Playback.getNextAction(Playback.kt:212) at org.droidmate.exploration.strategy.playback.Playback.chooseAction$suspendImpl(Playback.kt:249) at org.droidmate.exploration.strategy.playback.Playback.chooseAction(Playback.kt) at org.droidmate.exploration.strategy.playback.Playback.internalDecide$suspendImpl(Playback.kt:227) at org.droidmate.exploration.strategy.playback.Playback.internalDecide(Playback.kt) at org.droidmate.exploration.strategy.AbstractStrategy.decide$suspendImpl(AbstractStrategy.kt:92) at org.droidmate.exploration.strategy.AbstractStrategy.decide(AbstractStrategy.kt) at org.droidmate.exploration.strategy.ExplorationStrategyPool.decide(ExplorationStrategyPool.kt:131) at org.droidmate.command.ExploreCommand.explorationLoop(ExploreCommand.kt:439) at org.droidmate.command.ExploreCommand.run(ExploreCommand.kt:390) at org.droidmate.command.ExploreCommand.tryExploreOnDeviceAndSerialize(ExploreCommand.kt:367) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1$1$invokeSuspend$$inlined$forEachIndexed$lambda$1.invokeSuspend(ExploreCommand.kt:344) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1$1$invokeSuspend$$inlined$forEachIndexed$lambda$1.invoke(ExploreCommand.kt) at org.droidmate.tools.ApkDeployer.withDeployedApk(ApkDeployer.kt:58) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1$1.invokeSuspend(ExploreCommand.kt:343) ... 18 more 16:38:45.015 [main] ERROR org.droidmate.frontend.ExceptionHandler - A nonempty ThrowablesCollection was thrown during DroidMate run. Each of the 1 Throwables will now be logged. 16:38:45.015 [main] ERROR org.droidmate.frontend.ExceptionHandler - A nonempty ThrowablesCollection was thrown during DroidMate run. Each of the 1 Throwables will now be logged. 16:38:45.015 [main] ERROR org.droidmate.frontend.ExceptionHandler - ======================================== 16:38:45.015 [main] ERROR org.droidmate.frontend.ExceptionHandler - ======================================== 16:38:45.015 [main] ERROR org.droidmate.frontend.ExceptionHandler - An ApkExplorationException was thrown during DroidMate run, pertaining to DerDieDas_v1.10_apkpure.com-instrumented.apk: org.droidmate.device.android_sdk.ApkExplorationException: kotlin.KotlinNullPointerException 16:38:45.015 [main] ERROR org.droidmate.frontend.ExceptionHandler - An ApkExplorationException was thrown during DroidMate run, pertaining to DerDieDas_v1.10_apkpure.com-instrumented.apk:

org.droidmate.device.android_sdk.ApkExplorationException: kotlin.KotlinNullPointerException at org.droidmate.tools.ApkDeployer.withDeployedApk(ApkDeployer.kt:66) at org.droidmate.tools.ApkDeployer$withDeployedApk$1.invokeSuspend(ApkDeployer.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32) at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:236) at kotlinx.coroutines.EventLoopBase.processNextEvent(EventLoop.kt:123) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:69) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking(Builders.kt:45) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking$default(Builders.kt:35) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1.invoke(ExploreCommand.kt:333) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1.invoke(ExploreCommand.kt:89) at org.droidmate.tools.AndroidDeviceDeployer.withSetupDevice(AndroidDeviceDeployer.kt:183) at org.droidmate.command.ExploreCommand.deployExploreSerialize(ExploreCommand.kt:332) at org.droidmate.command.ExploreCommand.execute(ExploreCommand.kt:314) at org.droidmate.command.ExploreCommand.execute(ExploreCommand.kt:240) at org.droidmate.frontend.DroidmateFrontend$Companion.execute(DroidmateFrontend.kt:131) at org.droidmate.frontend.DroidmateFrontend$Companion.execute$default(DroidmateFrontend.kt:97) at org.droidmate.frontend.DroidmateFrontend$Companion.main(DroidmateFrontend.kt:86) at org.droidmate.frontend.DroidmateFrontend.main(DroidmateFrontend.kt) Caused by: kotlin.KotlinNullPointerException: null at org.droidmate.exploration.strategy.playback.Playback.getNextAction(Playback.kt:212) at org.droidmate.exploration.strategy.playback.Playback.chooseAction$suspendImpl(Playback.kt:249) at org.droidmate.exploration.strategy.playback.Playback.chooseAction(Playback.kt) at org.droidmate.exploration.strategy.playback.Playback.internalDecide$suspendImpl(Playback.kt:227) at org.droidmate.exploration.strategy.playback.Playback.internalDecide(Playback.kt) at org.droidmate.exploration.strategy.AbstractStrategy.decide$suspendImpl(AbstractStrategy.kt:92) at org.droidmate.exploration.strategy.AbstractStrategy.decide(AbstractStrategy.kt) at org.droidmate.exploration.strategy.ExplorationStrategyPool.decide(ExplorationStrategyPool.kt:131) at org.droidmate.command.ExploreCommand.explorationLoop(ExploreCommand.kt:439) at org.droidmate.command.ExploreCommand.run(ExploreCommand.kt:390) at org.droidmate.command.ExploreCommand.tryExploreOnDeviceAndSerialize(ExploreCommand.kt:367) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1$1$invokeSuspend$$inlined$forEachIndexed$lambda$1.invokeSuspend(ExploreCommand.kt:344) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1$1$invokeSuspend$$inlined$forEachIndexed$lambda$1.invoke(ExploreCommand.kt) at org.droidmate.tools.ApkDeployer.withDeployedApk(ApkDeployer.kt:58) at org.droidmate.command.ExploreCommand$deployExploreSerialize$1$1.invokeSuspend(ExploreCommand.kt:343) ... 18 common frames omitted

Setup: Android 7.1.1 NEXUS 9 API 25 emulator with Android Studio version 3.2.1 All the Apk has been instrumented

Thank you

JeannedArk commented 5 years ago

Thanks, I will look into it.

Hotzkow commented 5 years ago

Hello, please check if commit 49820ae5c893b2dbfe6046331351bd91431b78f0 fixes your issue.

natanieljr commented 3 years ago

Assuming everything is working since there was no feedback after the solution