Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Android and the new gradle build system

Discussion in '5.5 Beta' started by paradizIsCool, Sep 20, 2016.

  1. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Hi,

    First, we're really happy to see that unity finally uses gradle to build Android apk.

    Now I want to test this feature and use it to tweak our build process, depending on environment for example.

    So I have a simple question, how can we provide a custom build.gradle file ?

    We'd like to add some dexOptions, repositories, aar dependencies...

    Thanks
     
  2. jonas-minnberg

    jonas-minnberg

    Unity Technologies

    Joined:
    Oct 8, 2014
    Posts:
    6
    That is not supported in the first version. But...
    The templates used for creating the build.gradle files are in PlaybackEngines/AndroidPlayer/Tools/GradleTemplates
    inside the Unity application directory, so as a hack in the current version you can try changing the mainTemplate.gradle directly.

    Most likely we will add support for providing your own template inside your project in an upcoming patch release.

    -- Jonas
     
  3. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Ok thanks, this is really more than a nice to have feature, especially if you think that we want to use cloudbuild.