maestro icon indicating copy to clipboard operation
maestro copied to clipboard

"illegal character (U+0)" crash after successful tap to change screen

Open mikemee opened this issue 2 years ago • 1 comments

Version: maestro 1.10.1

Yaml:

# happy-path.yaml

appId: my.app
---
- launchApp
- tapOn: "By Publisher"
- tapOn: "Puzzle #1"

The Android app opens correctly in the simulator. It can find text on the screen with assertVisible and scroll and `tapOn'. When it goes to a new screen in the app by tapping "Puzzle #1" the crash happens. The new screen is displayed in the app quickly and for at least a second or two before the crash log.

I added -hideKeyboard immediately after as I saw that referenced in closed bugs, but it crashes the same way with or without. This crashes the same way in both the simulator or on a physical device.

Crash log from adb:

Exception while executing runnable io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed@8930b1a
java.lang.IllegalArgumentException: Illegal character (U+0)
at com.android.org.kxml2.io.KXmlSerializer.reportInvalidCharacter(KXmlSerializer.java:182)
at com.android.org.kxml2.io.KXmlSerializer.writeEscaped(KXmlSerializer.java:173)
at com.android.org.kxml2.io.KXmlSerializer.attribute(KXmlSerializer.java:495)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:86)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec(ViewHierarchy.kt:115)
at dev.mobile.maestro.ViewHierarchy.dumpNodeRec$default(ViewHierarchy.kt:73)
at dev.mobile.maestro.ViewHierarchy.dump(ViewHierarchy.kt:53)
at dev.mobile.maestro.Service.viewHierarchy(MaestroDriverService.kt:78)
at maestro_android.MaestroDriverGrpc$MethodHandlers.invoke(MaestroDriverGrpc.java:344)
at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:340)
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:866)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)

Crash log from maestro:

io.grpc.StatusRuntimeException: UNKNOWN   
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
	at maestro_android.MaestroDriverGrpc$MaestroDriverBlockingStub.viewHierarchy(MaestroDriverGrpc.java:270)
	at maestro.drivers.AndroidDriver.contentDescriptor(AndroidDriver.kt:254)
	at maestro.ViewHierarchy$Companion.from-c1iYVAs(ViewHierarchy.kt:28)
	at maestro.Maestro.viewHierarchy-prqvCes(Maestro.kt:278)
	at maestro.Maestro.waitForAppToSettle-prqvCes(Maestro.kt:317)
	at maestro.Maestro.tap(Maestro.kt:190)
	at maestro.Maestro.tap(Maestro.kt:147)
	at maestro.orchestra.Orchestra.tapOnElement(Orchestra.kt:350)
	at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:129)
	at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:111)
	at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:73)
	at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:105)
	at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:32)
	at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:29)
	at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:116)
	at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:29)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:60)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:30)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
	at picocli.CommandLine.access$1200(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at maestro.cli.AppKt.main(App.kt:94)

mikemee avatar Oct 18 '22 09:10 mikemee

Having a similar type of error while running script in windows.

Firstly a file not found error has occurred then I moved the .android folder which contains adb key to maestro bin folder after that i tried running the script then another error started coming as " illegal base64 character d". i don't know how to clear the error. Attaching the images for referrence As you can see, the first image is file not found error image. image

the second image is after i moved the .android folder to the maestro bin folder. image

LalithKumar702 avatar Oct 20 '22 07:10 LalithKumar702

Thanks for taking the time to raise this issue! There has been a lot of improvements and fixes on Maestro since this was raised so we’ll go ahead and close this one out as part of an issue cleanup - if you still experience issues, please open a new issue with reproduction steps. Thanks again for using maestro!

axelniklasson avatar May 03 '23 13:05 axelniklasson

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. Thank you for helping keep us our issue tracker clean!

github-actions[bot] avatar Jul 11 '24 14:07 github-actions[bot]