godot: Exporting to android now fails with error code 20

Godot version: 72c44bafac6e280b5e1e99b417588624bfb5ecc6

OS/device including version: MacOS 10.15.12

Issue description: When compiling from 72c44bafac6e280b5e1e99b417588624bfb5ecc6 my android export is now broken where it was successful before.

when using a custom build I get this:

arguments
0: ./editor/godot.osx.opt.tools.64
1: --path
2: project
3: --export
4: android
5: ../export/android/GameOne.apk
Current path: /Users/mattiasmyhrman/Repositories/gameone
Godot Engine v3.2.rc.custom_build.7617336d7 - https://godotengine.org
OpenGL ES 3.0 Renderer: NVIDIA GeForce GTX 775M OpenGL Engine
 
Registered camera FaceTime HD Camera (Built-in) with id 1 position 0 at index 0
export: begin: Exporting for Android steps: 105
export: end
ERROR: _fs_changed: Project export failed with error code 20 for preset 'android'.
   At: editor/editor_node.cpp:634.

When not using a custom build it exports successfully however when pushing to device I get

adb: failed to install export/android/GameOne.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
Starting: Intent { act=android.intent.action.MAIN cmp=org.godotengine.gameone/com.godot.game.GodotApp }
Error type 3
Error: Activity class {org.godotengine.gameone/com.godot.game.GodotApp} does not exist.

Both of these were working in rc1 IIRC so something seems to have happened with the manifest regeneration(?)

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 1
  • Comments: 20 (8 by maintainers)

Most upvoted comments

@Myran Maybe we could add an --install-export-template <file> command-line argument that installs a TPZ file or Android source ZIP in the right location. This way, the user doesn’t need to know in advance the version identifier to use. This means you’d have to run the Godot headless binary twice in CI environments, but it’s probably not an issue.

@Calinou do you have any updates regarding:

@Myran Maybe we could add an --install-export-template command-line argument that installs a TPZ file or Android source ZIP in the right location. This way, the user doesn’t need to know in advance the version identifier to use. This means you’d have to run the Godot headless binary twice in CI environments, but it’s probably not an issue.

If not, do you have a script that can install the templates correctly that I can run in CI/CD? I did the following which didn’t succeed:

curl -LO ${GODOT_TEMPLATES_URL} && unzip Godot_v${GODOT_VERSION}-stable_export_templates.tpz
mkdir -p "${GODOT_TEMPLATES_DIR}" && mv templates "${GODOT_TEMPLATES_DIR}/${GODOT_VERSION}.stable"

Havent looked at this repo in a while and went digging. Its rough around the edges but it worked AFAIK. At this point the details are very hazy unfortunately…

Building the android export based on custom godot version (3.2 somewhere IIRC) using this script:

cd godot-myran

scons platform=android target=release_debug android_arch=armv7 --jobs=$(sysctl -n hw.logicalcpu) # module_bmp_enabled=no module_bullet_enabled=no module_csg_enabled=no module_dds_enabled=no module_enet_enabled=no module_etc_enabled=no module_gdnative_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_mbedtls_enabled=yes module_mobile_vr_enabled=no module_opus_enabled=no module_pvr_enabled=no module_recast_enabled=no module_regex_enabled=no module_squish_enabled=no module_tga_enabled=no module_thekla_unwrap_enabled=no module_theora_enabled=no module_tinyexr_enabled=no module_vorbis_enabled=no module_webm_enabled=no module_websocket_enabled=no disable_advanced_gui=no disable_3d=yes optimize=size use_lto=yes
scons platform=android target=release_debug android_arch=arm64v8 --jobs=$(sysctl -n hw.logicalcpu) # module_bmp_enabled=no module_bullet_enabled=no module_csg_enabled=no module_dds_enabled=no module_enet_enabled=no module_etc_enabled=no module_gdnative_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_mbedtls_enabled=yes module_mobile_vr_enabled=no module_opus_enabled=no module_pvr_enabled=no module_recast_enabled=no module_regex_enabled=no module_squish_enabled=no module_tga_enabled=no module_thekla_unwrap_enabled=no module_theora_enabled=no module_tinyexr_enabled=no module_vorbis_enabled=no module_webm_enabled=no module_websocket_enabled=no disable_advanced_gui=no disable_3d=yes optimize=size use_lto=yes
scons platform=android target=release android_arch=armv7 --jobs=$(sysctl -n hw.logicalcpu) module_bmp_enabled=no module_bullet_enabled=no module_csg_enabled=no module_dds_enabled=no module_enet_enabled=no module_etc_enabled=no module_gdnative_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_mbedtls_enabled=yes module_mobile_vr_enabled=no module_opus_enabled=no module_pvr_enabled=no module_recast_enabled=no module_regex_enabled=no module_squish_enabled=no module_tga_enabled=no module_thekla_unwrap_enabled=no module_theora_enabled=no module_tinyexr_enabled=no module_vorbis_enabled=no module_webm_enabled=no module_websocket_enabled=no disable_advanced_gui=no disable_3d=yes optimize=size use_lto=yes
scons platform=android target=release android_arch=arm64v8 --jobs=$(sysctl -n hw.logicalcpu) module_bmp_enabled=no module_bullet_enabled=no module_csg_enabled=no module_dds_enabled=no module_enet_enabled=no module_etc_enabled=no module_gdnative_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_mbedtls_enabled=yes module_mobile_vr_enabled=no module_opus_enabled=no module_pvr_enabled=no module_recast_enabled=no module_regex_enabled=no module_squish_enabled=no module_tga_enabled=no module_thekla_unwrap_enabled=no module_theora_enabled=no module_tinyexr_enabled=no module_vorbis_enabled=no module_webm_enabled=no module_websocket_enabled=no disable_advanced_gui=no disable_3d=yes optimize=size use_lto=yes

cd platform/android/java
./gradlew generateGodotTemplates
cd ../../../../

echo "Moving templates...."
mv godot-myran/bin/android_debug.apk templates/android_debug.apk
mv godot-myran/bin/android_release.apk templates/android_release.apk
mv godot-myran/bin/android_source.zip templates/android_source.zip

this is the android part in the gitlab CI which uses it.

.play_store_internal: &common_play_store_internal
  stage: deploy_tests
  variables:
   GIT_SUBMODULE_STRATEGY: none
  script:
  # test move
    - ./install_android_source.sh
    - ./firebase_install.sh
    - ./editor/godot.osx.opt.tools.64 --path project -s update_android_export_config.gd --no-window --export_android_version=$CI_PIPELINE_IID --keystore_release_path=$CI_PROJECT_DIR/keys/gameone.keystore --keystore_debug_path=$CI_PROJECT_DIR/keys/debug.keystore --template_release_path=$CI_PROJECT_DIR/templates/android_release.apk --template_debug_path=$CI_PROJECT_DIR/templates/android_debug.apk
    - find ~/.gradle -type f -name "*.lock" -delete
    - ./editor/godot.osx.opt.tools.64 --path project --debug --verbose --no-window --export android $CI_PROJECT_DIR/export/android/GameOne.apk
  # ---
    - cd export/android/
    - fastlane internal
    -

the script “install_android_source.sh” :

echo "installing android gradle for custom builds"
cd templates/
mkdir build
unzip -o android_source.zip -d build
rm -rf ../project/android/build
mv build ../project/android/
chmod +x ../project/android/build
cd ..
echo "Done!"

@Calinou do you have any updates regarding:

@Myran Maybe we could add an --install-export-template command-line argument that installs a TPZ file or Android source ZIP in the right location. This way, the user doesn’t need to know in advance the version identifier to use. This means you’d have to run the Godot headless binary twice in CI environments, but it’s probably not an issue.

See https://github.com/godotengine/godot-proposals/issues/1277. Nobody is currently working on implementing this feature, but pull requests are welcome 🙂