How to create export templates

SomianSomian Posts: 7Member
edited February 2019 in Exporting

Hi,

I created my own Godot module and can use it from within the editor. Now I would like to export, but since I technically build a custom version, it says "export templates for this platform are missing".

How do I create an export template? I'm on a Mac, and for now, I would like to create a macOS application.

There are instructions here on how to build for macOS, and it allows me to successfully create the corresponding Godot editor binary, but I don't know how to create the export template so I can actually create the application using the module I created.

It says I can use misc/dist/osx_tools.app, but that's technically a folder and I can't even select it in the "install from file" dialog.

Edit: I also tried the dialog under "custom package" but that asks for a .zip file and not a .app folder.

Edit 2: I also tried to build for android, and according to the documentation ", "You don’t even need to copy them, you can just reference the resulting file in the bin\ directory of your Godot source folder, so that the next time you build you will automatically have the custom templates referenced."

However, even after choosing the two APKs, the export button is still greyed out.

Answers

  • SparrowSparrow Posts: 53Member
    edited February 2019

    Hi Somain

    yeah i had issues with this too, there's a good video here

    https://youtube.com/watch?v=cXahUh9Zfho

    but basically Manage Export templates, download them here https://godotengine.org/download/osx

    and install, you may need to save and re-open then export should work.

    Good luck.

  • SomianSomian Posts: 7Member
    edited February 2019

    The export templates I can download from the website are for 3.06 (I already have those). My Question is how I can make my own export templates based on the custom Godot version I have because I created my own module.

    (In the video, they're also downloading templates).

    Or to ask differently: where do the export templates on the website come from and how can I build them myself?

    Thanks! :)

  • 44pes44pes Posts: 13Member
    edited February 2019

    I use Linux but I guess the steps are similar in MAC. This is what I do to build for Android:

    1º Add the code of the modules to the modules folder
    "Godot source code folder"/modules/

    2º Compile the templates

    scons -j 8 platform=android --config=force target=release_debug android_arch=armv7              
    scons -j 8 platform=android --config=force target=release_debug android_arch=arm64v8                
    scons -j 8 platform=android --config=force target=release_debug android_arch=x86                
    scons -j 8 platform=android --config=force target=release_debug android_arch=x86_64                 
    
    scons -j 8 platform=android --config=force target=release android_arch=armv7                    
    scons -j 8 platform=android --config=force target=release android_arch=arm64v8                  
    scons -j 8 platform=android --config=force target=release android_arch=x86                  
    scons -j 8 platform=android --config=force target=release android_arch=x86_64       
    
    cd platform/android/java
    ./gradlew clean build
    

    The templates templates are created in: "Godot source code folder"/bin/

    3º Add the modules to the project.godot file
    Go to the folder of your project and add the module to the list of modules to use.

    [android]
    modules="org/godotengine/godot/xxxxx" 
    

    4º Add the templates in the export config window

    5º Export

    I do not think you need more steps.

    Have you looked at the Android log for errors?

  • CalinouCalinou Posts: 334Admin Godot Developer
    edited February 2019

    To create macOS export templates:

    • Copy the osx_template.app/ directory which is located in misc/dist/ in the Godot source directory (it can be placed anywhere; for demonstration, I'll assume it was copied to bin/).

    • Build export template binaries for macOS in debug and release mode:

    scons platform=osx tools=no target=release_debug -j8
    scons platform=osx tools=no target=release -j8
    
    • Copy binaries over to the osx_template.app/ directory in the right location:
    mkdir "bin/osx_template.app/Contents/MacOS"
    cp "bin/godot.osx.opt.debug.64" "bin/osx_template.app/Contents/MacOS/godot_osx_debug.64"
    cp "bin/godot.osx.opt.64" "bin/osx_template.app/Contents/MacOS/godot_osx_release.64"
    
    • Compress osx_template.app/ into a ZIP archive:
    cd "bin/"
    zip -r9 "osx.zip" "osx_template.app/"
    
    • Place osx.zip in ~/Library/Application Support/Godot/templates/3.0.6.stable/ (create directories as needed).

    See osx_templates.sh in my Godot build scripts repository for an example script.

  • SomianSomian Posts: 7Member
    edited February 2019

    Thanks!

    I tried the Mac version for now.

    It starts the export now, but I get the error:

    Exporting to /Users/[username]/Library/Caches/Godot/[projectname]_Desktop.app
    Creating /Users/[username]/Library/Caches/Godot/[projectname]_Desktop.app/Contents/MacOS
    Creating /Users/[username]/Library/Caches/Godot/[projectname]_Desktop.app/Contents/Frameworks
    Creating /Users/[username]/Library/Caches/Godot/[projectname]_Desktop.app/Contents/Resources
    READ: osx_template.app/
    READ: osx_template.app/Contents/
    READ: osx_template.app/Contents/MacOS/
    READ: osx_template.app/Contents/MacOS/godot_osx_debug.64
    ADDING: Contents/MacOS/[projectname]_Desktop size: 44170800
    READ: osx_template.app/Contents/MacOS/godot_osx_release.64
    READ: osx_template.app/Contents/Resources/
    READ: osx_template.app/Contents/Resources/icon.icns
    icon? res://icon.png
    loaded?
    ADDING: Contents/Resources/icon.icns size: 50550
    READ: osx_template.app/Contents/Info.plist
    parse plist
    ADDING: Contents/Info.plist size: 1121
    READ: __MACOSX/
    READ: __MACOSX/osx_template.app/
    READ: __MACOSX/osx_template.app/Contents/
    READ: __MACOSX/osx_template.app/Contents/._Info.plist
    ADDING: __MACOSX/Contents/._Info.plist size: 176
    ERROR: _export_project_to_path: Failed to export project
    At: editor/project_export.cpp:748.

    EDIT:

    I think the problem might have been that the module when I build the editor and when I built the export templates wasn't consistent. I just rebuild the editor first and then the export templates. (following order: ) …

    scons platform=osx -j16 scons platform=osx tools=no target=release_debug -j16 scons platform=osx tools=no target=release -j16

    … and then I

    • moved and renamed the export templates as described by Calinou (just using the folder name of the branch my godot is on).
    • started the editor end exported for Mac.
    • BAM!

    Another question: how can I change the name of the build/folder path so I can give my custom Godot build a name? Currently it's named "3.0.7.devel" because that's what I forked off of.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file