2

I'm trying to sign my android app with apksigner.

Typing this command

apksigner sign --ks my-release-key.jks my-app.apk

Gives the error sh.exe": apksigner: command not found

While adding 'bat' apksigner.bat sign --ks my-release-key.jks my-app.apk

gives me the error

    /c/Users/Lenovo/AppData/Local/Android/sdk/build-tools/26.0.2/apksigner.bat: line 1: @echo: command not found
/c/Users/Lenovo/AppData/Local/Android/sdk/build-tools/26.0.2/apksigner.bat: line 2: syntax error near unexpected token `('
/c/Users/Lenovo/AppData/Local/Android/sdk/build-tools/26.0.2/apksigner.bat: line 2: `REM Copyright (C) 2016 The Android Open Source Project'

I made sure I have android build tools folder in my PATH, and that apksigner.bat is present there. Typing something like apksigner sign --help and apksigner.bat sign --help gives the same errors.

ktw16
  • 109
  • 1
  • 2
  • 6

1 Answers1

1

From the path in your question it looks like you are on a windows machine, but all the pathnames you give have '/' paths, which don't look like Windows paths. Can you give more details of your environment? It looks like you might be using something like cygwin, and the problem is there.

Nick Fortescue
  • 13,530
  • 1
  • 31
  • 37