Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Export for Android #134

Open
nongvantinh opened this issue Sep 22, 2024 · 5 comments
Open

Unable to Export for Android #134

nongvantinh opened this issue Sep 22, 2024 · 5 comments

Comments

@nongvantinh
Copy link
Contributor

I have added the Android export and tested it on my local machine with the command:

.\godot.windows.editor.dev.x86_64.mono.console.exe --path "D:\GodotProjects\azheir\test-ci-cd" --export-release "Android" "D:\GodotProjects\azheir\build\Android\azheir.apk" --headless

It works locally; however, when I push to GitHub, it cannot export for Android. Prior to this, exports for Windows and Linux worked well.

Here is the full export log:

🖥️ Exporting preset Android
/home/runner/.local/share/godot/godot_executable/Godot_v4.3-stable_mono_linux_x86_64/Godot_v4.3-stable_mono_linux.x86_64 /home/runner/work/azheir/azheir/test-ci-cd/project.godot --headless --export-release Android /home/runner/.local/share/godot/builds/Android/azheir.apk
Godot Engine v4.3.stable.mono.official.77dcf97d8 - https://godotengine.org
export: begin: Exporting for Android steps: 105
0 param: --xr_mode_regular
1 param: --use_immersive
export: step 0: Creating APK...
...
WARNING: Code Signing: Could not find keystore, unable to export.
       at: add_message (editor/export/editor_export_platform.h:179)
export: end
ERROR: Project export for preset "Android" failed.
     at: _fs_changed (editor/editor_node.cpp:1028)
ERROR: Condition "!EditorSettings::get_singleton() || !EditorSettings::get_singleton()->has_setting(p_setting)" is true. Returning: Variant()
     at: _EDITOR_GET (editor/editor_settings.cpp:1289)
Error: The process '/home/runner/.local/share/godot/godot_executable/Godot_v4.3-stable_mono_linux_x86_64/Godot_v4.3-stable_mono_linux.x86_64' failed with exit code 1

It appears that there is an issue with the keystore, as it states, "Could not find keystore, unable to export." I tried to add environment variables:

- name: Set Environment Variables
  run: |
    echo "GODOT_ANDROID_KEYSTORE_RELEASE_PATH=${{ secrets.GODOT_ANDROID_KEYSTORE_RELEASE_PATH }}" >> $GITHUB_ENV
    echo "GODOT_ANDROID_KEYSTORE_RELEASE_USER=${{ secrets.GODOT_ANDROID_KEYSTORE_RELEASE_USER }}" >> $GITHUB_ENV
    echo "GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD=${{ secrets.GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD }}" >> $GITHUB_ENV

But that's not working.

@nongvantinh
Copy link
Contributor Author

nongvantinh commented Sep 22, 2024

Repleace with

          echo "GODOT_ANDROID_KEYSTORE_RELEASE_PATH=${{ vars.GODOT_ANDROID_KEYSTORE_RELEASE_PATH }}" >> $GITHUB_ENV
          echo "GODOT_ANDROID_KEYSTORE_RELEASE_USER=${{ vars.GODOT_ANDROID_KEYSTORE_RELEASE_USER }}" >> $GITHUB_ENV
          echo "GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD=${{ vars.GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD }}" >> $GITHUB_ENV

Gives the same error
image

@OffsetMonkey538
Copy link

But does the release.jks file actually exist at ~/.config/godot on the github actions runner? I'm not really sure how, but somehow i'd hope it's possible to like store its content in a secret and then write that to a file or something like that.

@nongvantinh
Copy link
Contributor Author

@OffsetMonkey538 It was a false alarm!

we don't need release.jks at all. Just create the keystore on your development machine and add it to your repository. Then, in the GitHub Action, set the following environment variables to the GitHub environment: GODOT_ANDROID_KEYSTORE_RELEASE_PATH, GODOT_ANDROID_KEYSTORE_RELEASE_USER, and GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD. After that, you’re good to go. Here is my working code:

- name: Initialize Environment
  run: |
    echo "GODOT_ANDROID_KEYSTORE_RELEASE_PATH=${{ github.workspace }}/misc/godot-release.keystore" >> $GITHUB_ENV
    echo "GODOT_ANDROID_KEYSTORE_RELEASE_USER=godot-release" >> $GITHUB_ENV
    echo "GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD=my-keystore-password" >> $GITHUB_ENV

image

@OffsetMonkey538
Copy link

well, make sure that's a debug keystore then, because you proobably don't want to share an actual signing key on github haha

@nongvantinh
Copy link
Contributor Author

I think that doing so is fine. You can create a private repository to store the keystore and then clone this repo in your workflow to use the keystore, or you can upload the keystore to a cloud service like AWS or Azure and download it in your workflow.

However, since I work alone, adding the keystore directly to my repo or separating it to another location doesn't make any difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants