Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Building multiple android apps via script does not trigger Resolving Android Dependencies

Discussion in 'Scripting' started by giggioz, Oct 3, 2020.

  1. giggioz

    giggioz

    Joined:
    May 11, 2017
    Posts:
    52
    I have a Unity Project which builds a number of smartphone android apps

    Anytime I need to build an app I have a script (SetupApp) that move a bunch of assets in the Resources folder and changes the package name.

    As far as I understood changing the package name triggers the tedious process of “Resolving Android Dependencies”, because all the various libraries in Plugins/Android need to be recompiled.

    So far so good.

    Recently I tried to create a multi-builder, basically it’s a script (MultiBuilder) that takes all the applications that need to be created and, before each, calls SetupApp and then calls BuildPipeline.BuildPlayer

    My issue is that when MultiBuilder calls SetupApp the “Resolving Android Dependencies” is not triggered, creating all the app with the same (wrong) dependencies.

    Some thoughts:
    Is there a way to force by script the “Resolving Android Dependencies” process?
    Is there a way to wait for the resolving process to be finished and the continue the building process?
    Is there a better way to do so?

    This goes really beyond my understanding of Unity, any help is very welcome.

    Thank you!
     
    Last edited: Oct 3, 2020
  2. giggioz

    giggioz

    Joined:
    May 11, 2017
    Posts:
    52
    Update:

    I spent many hours today trying different hacks but basically I don't understand this topic very well to find a good solution. I've also tried to put an async/await sleep in the script hoping that the Dependencies resolver could have jumped in between but no luck.