Exporting to android gives: 'apksigner' returned with error #1

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By LyguN

Just yesterday I was exporting the game without any problems but when I tried to do it today I got the error mentioned in the title.

Editor settings and export settings are all set with correct paths and keystore user and keystore pass are also set correctly.

I’ve tried:

Installing build_tools 30.0.3 and uninstalling all other versions.

Installing everything else that is mentioned in the android export docs page with the correct version.

Installing OpenJDK 11 and Open JDK 17 and re-generating the debuy key for both versions.

Reinstalling android studio completely.

I also tried changing the jarsigner path in the editor settings to the apksigner.bat path since some people said that thats what you should do.

None of these worked and I got the same result everytime.

1 Like
:bust_in_silhouette: Reply From: Poobslag

I encountered this problem today in Godot 3.4.2. Like you, I tried experimented with changing several paths, installing new versions of build_tools and upgrading my JDK. The following finally fixed my issue:

  • Uninstall OpenJDK 11 (and OpenJDK 8, if you have it)
  • Uninstall Android Studio
  • Delete all files from %USER_HOME%\appdata\Local\Android\Sdk
  • Reinstall OpenJDK 11
  • Install the Android SDK using the command line tools described in Godot’s instructions: sdkmanager --sdk_root=<android_sdk_path> "platform-tools" "build-tools;30.0.3" "platforms;android-29" "cmdline-tools;latest" "cmake;3.10.2.4988404" "ndk;21.4.7075529"

I think the most crucial step is deleting the files from %USER_HOME%\appdata\Local\Android\Sdk. Other similar threads indicate that the apksigner fails if you have older build-tools versions installed.

Thank You! Simply deleting the Sdk folder that you mentioned and reinstalling it fixed the issue for me!

LyguN | 2022-01-03 22:39

Thank You! It helped me as well. I was about to give up. Now it finally works. :slight_smile:

aya9 | 2022-11-12 18:27

2 Likes

That worked! Thank you