- Home /
How to export to gradle using BuildPipeline.BuildPlayer
I'm having a problem with exporting android project to gradle. I can do it manually with no problem. Open CMD and type gradle build. Everything is fine. What I try to achieve is to automate builds using Jenkins. I can build everything using BuildPipeline.BuildPlayer. Only problem is gradle, because unity is building apk and I would like only to export project to gradle so I can later add some stuff to gradle.build file. How I can do this using BuildPipeline.BuildPlayer?
Answer by infinitedev · Jan 28, 2017 at 08:51 AM
I was stuck on this as well and couldn't find anything in the docs.
The answer appears to be to include the BuildOptions.AcceptExternalModificationsToPlayer with the build options passed to BuildPipeline.BuildPlayer.
I've tested this myself and it worked.
I got the idea to try this from https://forum.unity3d.com/threads/unity-4-2-automate-export-of-google-android-project.194963/
Answer by devluz · Feb 03 at 01:17 AM
For anyone here from the future: Try EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
Your answer
Follow this Question
Related Questions
How to add compiler or linker flags for il2cpp invocation. 3 Answers
Unable to build to Android and iOS using BuildPipeline Failed to copy files 1 Answer
Please help :) Average android build size in 2018.2 1 Answer
Android exporting progress 0 Answers
Scenes turning blue when changing platform to WebGL 1 Answer