android_custom_build.rst 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .. _doc_android_custom_build:
  2. Custom builds for Android
  3. =========================
  4. Godot provides the option to use custom build Android templates. Instead of
  5. using the already pre-built template that ships with Godot, an actual Android
  6. Java project gets installed into your project folder. Godot will then build it
  7. and use it as an export template every time you export the project.
  8. There are some reasons why you may want to do this:
  9. * Modify the project before it's built.
  10. * Add external SDKs that build with your project.
  11. Configuring the custom build is a fairly straightforward process. But first
  12. you need to follow the steps in :ref:`exporting for android<doc_exporting_for_android>`
  13. up to **Setting it up in Godot**. After doing that, follow the steps below.
  14. Set up the custom build environment
  15. -----------------------------------
  16. Go to the Project menu, and install the *Custom Build* template:
  17. .. image:: img/custom_build_install_template.png
  18. Make sure export templates are downloaded. If not, this menu will help you
  19. download them.
  20. A Gradle-based Android project will be created under ``res://android/build``.
  21. Editing these files is not needed unless you want to :ref:`create
  22. your own add-ons<doc_android_plugin>`, or you really need to modify the project.
  23. Enabling the custom build and exporting
  24. ---------------------------------------
  25. When setting up the Android project in the **Project > Export** dialog,
  26. **Custom Build** needs to be enabled:
  27. .. image:: img/custom_build_enable.png
  28. From now on, attempting to export the project or one-click deploy will call the
  29. `Gradle <https://gradle.org/>`__ build system to generate fresh templates (this
  30. window will appear every time):
  31. .. image:: img/custom_build_gradle.png
  32. The templates built will be used automatically afterwards, so no further
  33. configuration is needed.