abarichello / godot-ci

Docker image to export Godot Engine games. Templates for Gitlab CI and GitHub Actions to deploy to GitLab Pages/GitHub Pages/Itch.io.
https://hub.docker.com/r/barichello/godot-ci
MIT License
753 stars 133 forks source link

Android export fail : no valid Android SDK Path #59

Closed clorl closed 2 years ago

clorl commented 3 years ago
ERROR: _fs_changed: Cannot export project with preset 'Android Debug' due to configuration errors:
A valid Android SDK path is required in Editor Settings.

This error appears when android debug export is setup using the demo ci stage. I don't know if I did something wrong or if it's a bug that needs to be fixed in the docker image.

Version: 3.3.2

2shady4u commented 3 years ago

This is due to the changes in android exporting introduces in the latest Godot versions. Basically following lines need to be added to the Dockerfile:

RUN sudo apt install android-sdk
RUN sdkmanager --sdk_root="/usr/lib/android-sdk" "platform-tools" "build-tools;30.0.3" "platforms;android-29" "cmdline-tools;latest" "cmake;3.10.2.4988404" "ndk;21.4.7075529"

RUN echo 'export/android/android_sdk_path = "/usr/lib/android-sdk"' >> ~/.config/godot/editor_settings-3.tres

Similarly, there are several obsolete lines that can be deleted pertaining to removed editor settings. @abarichello @asheraryam

abarichello commented 3 years ago

I'm not sure how to reproduce this error. Just tested the android APK output from the 3.3.3 version and it works perfectly. https://gitlab.com/barichello/godot-ci/-/jobs/1517625863

2shady4u commented 3 years ago

Not sure how it is working in your case.. I'll have to check for differences. But in my case I do get this error: image

And it was working in older versions of Godot (before 3.3.2). I'll try to figure what is going on here...

2shady4u commented 3 years ago

@abarichello the job that you linked is running on Godot 3.2.3: image

That's why it is working in your case 😄

The Godot version needs to be updated in that project's YAML: https://gitlab.com/barichello/godot-ci/-/blob/master/.gitlab-ci.yml ALSO this needs to be updated in the github YAML as well: https://github.com/abarichello/godot-ci/blob/master/.github/workflows/godot-ci.yml

In both cases the Godot version is still set at 3.2.3 there.

abarichello commented 3 years ago

Lol, you're right. I'll test your changes then

abarichello commented 3 years ago

@2shady4u I just created a test tag with your changes, now I'm having an apksigner path error that I can't find a solution for 🤔 https://github.com/abarichello/godot-ci/tree/test https://gitlab.com/barichello/godot-ci/-/jobs/1656163512 I also couldn't find the obsolete lines you mentioned.

2shady4u commented 3 years ago

@abarichello doing some testing myself https://github.com/2shady4u/godot-ci/tree/fix-android-export

I don't know if it works yet since new Docker doesn't allow me to auto-build from repo anymore :/ But to answer your questions:

RUN echo 'export/android/adb = "/usr/bin/adb"' >> ~/.config/godot/editor_settings-3.tres
RUN echo 'export/android/jarsigner = "/usr/bin/jarsigner"' >> ~/.config/godot/editor_settings-3.tres
RUN echo 'export/android/timestamping_authority_url = ""' >> ~/.config/godot/editor_settings-3.tres

Thus they can be removed.

maxim-sheronov commented 2 years ago

Hey, there is one more issue. Latest android-sdk doesn't include sdkmanager, so I figured out it to work with something like that before calling sdkmanager:

ENV ANDROID_HOME="/usr/lib/android-sdk"
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip
RUN unzip commandlinetools-linux-*_latest.zip -d cmdline-tools
RUN mv cmdline-tools $ANDROID_HOME/

ENV PATH="${ANDROID_HOME}/cmdline-tools/cmdline-tools/bin:${PATH}"
realkotob commented 2 years ago

@maxim-sheronov PR is welcome if you want to contribute the fix!

maxim-sheronov commented 2 years ago

@maxim-sheronov PR is welcome if you want to contribute the fix!

Well, I made it working in custom image, so I probably can prepare a PR to make it available for people.

dozingpip commented 2 years ago

I'm getting this error for the mono-3.4.2 image... Not sure if I should open it as a new issue or what? Exact failure message:

ERROR: Cannot export project with preset "Android" due to configuration errors:
Debug keystore not configured in the Editor Settings nor in the preset.
A valid Android SDK path is required in Editor Settings.
   at: _fs_changed (editor/editor_node.cpp:778)
ERROR: Project export failed with error code 3 for preset "Android".
   at: _fs_changed (editor/editor_node.cpp:801)

I also tried adding

echo $ANDROID_HOME
cat ~/.config/godot/editor_settings-3.tres

to the script for the build but got back:

$ echo $ANDROID_HOME
$ cat ~/.config/godot/editor_settings-3.tres
cat: /root/.config/godot/editor_settings-3.tres: No such file or directory

and it failed directly after that on that run.

Header from my pipeline log:

Running with gitlab-runner 14.8.0~beta.44.g57df0d52 (57df0d52)
  on blue-2.shared.runners-manager.gitlab.com/default XxUrkriX
Preparing the "docker+machine" executor 01:03
Using Docker executor with image barichello/godot-ci:mono-3.4.2 ...
Pulling docker image barichello/godot-ci:mono-3.4.2 ...
Using docker image sha256:cb8b24f1fd1d17af2f76eb4bb73dcb5781bfe9be35abb1dba7e9514b8afde8c6 for barichello/godot-ci:mono-3.4.2 with digest barichello/godot-ci@sha256:5f41a0a9ba6ea1eeaa3454863d7e4e8c5d37eee70bea4136d4eabd130a2ed963 ...
Calinou commented 2 years ago

@dozingpip Exporting Mono projects for Android is not supported yet: https://github.com/abarichello/godot-ci/issues/50