question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FileNotFoundException: .android\adbkey on Windows computer

See original GitHub issue

Hi,

This tool look pretty nice, but I’m having some issues to make it work on my Windows 11 computer.

When I run the command from a PowerShell, I get the following exception:

> maestro --platform android test .\login-flow.yaml
java.io.FileNotFoundException: .android\adbkey (The system cannot find the path specified)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:187)
        at dadb.AdbKeyPair$Companion.generate(AdbKeyPair.kt:103)
        at dadb.AdbKeyPair$Companion.readDefault(AdbKeyPair.kt:77)
        at dadb.Dadb$Companion.discover$default(Dadb.kt:196)
        at maestro.cli.util.MaestroFactory.createAndroid(MaestroFactory.kt:50)
        at maestro.cli.util.MaestroFactory.createMaestro(MaestroFactory.kt:35)
        at maestro.cli.command.TestCommand.call(TestCommand.kt:58)
        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:74)

I’m using maestro 1.5.0.

Any input?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
frichezcommented, Sep 18, 2022

same issue using Windows10 : java.lang.IllegalArgumentException: Illegal base64 character d Workarounds:

  • Convert C:\Users<your username>.android\adbkey from CRLF to LF
  • Launching maestro using git bash If we launch pwershell or cmd we need to copy the .android\adbkey folder into the folder where we launch the maestro command.
2reactions
mkierescommented, Sep 22, 2022

Faced the same error:

java.lang.IllegalArgumentException: Illegal base64 character d

I converted the adbkey file, in my user directory (i.e. C:\Users\<User>\.android), as suggested above to the UNIX way (LF) of ending lines (EOL), as opposed to the default on Windows (CR LF) using Notepad++ and I was able to run my tests successfully.

image

However, the steps in the VS Code console (powershell) are not updating (missing the green ticks?), even though the test is progressing successfully through them.

image

Windows Version: 10.0.19044 Build 19044

EDIT:

I noticed that I need to kill the app entirely on the emulator to get the test go through all of the test steps, otherwise it stops after launching the app

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are the .android folders and adbkey files on my computer?
Inside the folder are just two files, adbkey and adbkey.pub . I have searched around and have found out that adbkey.pub is a...
Read more >
Use of adbkey and adbkey.pub file present in my windows ...
So whenever you connect from a computer using adb, the phone recognizes it based on the adbkey file and either accepts the connection...
Read more >
why sometime it throws FileNotFoundException - Stack Overflow
I can think of the following possible reasons for this behavior: The new file could not be created simply because there is no...
Read more >
[SOLVED] Unable to access with ADB/No RSA Fingerprint Key ...
There are no files on my computer to delete (adbkey and adbkey.pub) my android folder is empty. what gives? Anyone able to answer...
Read more >
Debugging System.IO.FileNotFoundException - Cause and fix
FileNotFoundException isn't always as simple as it seems. Learn about the causes and fixes, including problems loading assemblies and IIS ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found