Search Unity

Question How to exclude a package when build for a specific platform?

Discussion in 'Package Manager' started by cdytoby, Jul 20, 2020.

  1. cdytoby

    cdytoby

    Joined:
    Nov 19, 2014
    Posts:
    181
    Usecase:

    I'm using Oculus package from package manager. When build for Android smartphone, I want to disable Oculus package, and enable it only when build for Oculus.

    But now when I build for Android smartphone, libOculusXRPlugin.so is still included in apk. How to prevent it from inclusion? using IFilterBuildAssemblies doesn't solve the problem. The so file is still included.

    Previously when everythings are assets in project, I can simply rename it by adding "~" at the end of folder name to exclude it. But now it won't work anymore because it's in package manager.
     
    kyubuns likes this.
  2. Shaunyowns

    Shaunyowns

    Joined:
    Nov 4, 2019
    Posts:
    328
    Hey there after speaking to the team they mentioned that you could embed the package, and temporarily ~-suffix its content. The workaround you are mentioning is adding "~" at the end of folder would work, but they need to embed the package first.

    https://docs.unity3d.com/Manual/upm-embed.html

    I hope this helps!
     
  3. FdenUijl

    FdenUijl

    Joined:
    Sep 5, 2019
    Posts:
    29
  4. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    361
    I'm interested in this issue as well. There should be a project setting that allow us to specify which package will be used for which platform. And we don't really want to use embedded packages, it will just enlarge the size of the main repo which is fairly big right now.
     
  5. kyubuns

    kyubuns

    Joined:
    Aug 6, 2013
    Posts:
    138
    I came across this thread because I wanted to use Unity Analytics only on a specific Platform.
    I'm hoping to be able to install the Package by specifying the Platform.