godotengine / godotengine/godot
Export Android: Godot fails to build an APK file but then it builds successfully.
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Godot 4.3 official release.
### System information
Windows 11, Godot 4.3.
### Issue description
Here is my projeect:
[capybara_math_test.zip](https://github.com/user-attachments/files/17504599/capybara_math_test.zip)
I've recorded a video about the bug (export to android):
[BugVideo.zip](https://github.com/user-attachments/files/17504470/BugVideo.zip)
Problem Description:
I've found that if I build an APK file with UseGradle=off the APK file will be corrupted/damaged and failed to build. Then if I set UseGradle=on and build again the APK file still will be corrupted. Then if I set back UseGradle=off and build again the APK file will be built successfully! A very strange bug.
My setup:
Java SDK 23.0.1
Android Studio 2024
### Steps to reproduce
1 Download Java SDK 23 https://download.oracle.com/java/23/latest/jdk-23_windows-x64_bin.zip
2 Install Android Studio 2024 https://developer.android.com/studio
3 Install Android Packages. Tools ->SDKManager.

4 Open my Godot project
[capybara_math_test.zip](https://github.com/user-attachments/files/17504599/capybara_math_test.zip)
5 Fix paths of AndroidSDK and JavaSDK

6 Build a project with Gradle=off

You will see this notification. The build fails and The APK file will be corrupted/broken.

7 Install Build Temlate:

8 Try to build again with Gradle=on

The build fails. You will see this notification.

9 Try to build again with Gradle=off.

The build will succeed and there will be no any warnings!!!
The build will succeed and there will be no any warnings!!!
The build will succeed and there will be no any warnings!!!
### Minimal reproduction project (MRP)
Here is my projeect:
[capybara_math_test.zip](https://github.com/user-attachments/files/17504599/capybara_math_test.zip)
Contributor guide
Assessment
This issue has not been assessed yet.