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. Dismiss Notice

Custom Package - PostProcessBuild

Discussion in 'Package Manager' started by z000z, Feb 4, 2020.

  1. z000z

    z000z

    Joined:
    Dec 31, 2014
    Posts:
    96
    I'm trying to build a custom package for iOS that uses the PostProcessBuild attribute to modify the Xcode project it's generating. The code works fine when not in a package, but when putting it into the package it can't find the UnityEditor namespace, during the build process.

    Is there an assembly reference I can add to the asmdef file to make it work? The code is sitting in a root Editor folder of the package already, with an asmdef file as well.
     
  2. z000z

    z000z

    Joined:
    Dec 31, 2014
    Posts:
    96
    It seems to be the asmdef file creating the issue, which from what I understand is required for a package. If I move the folder out of the package into the the project directly and remove the asmdef it works properly. I'm not seeing any way to include a reference to the UnityEditor though.
     
  3. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    102
    Hi there,

    If you select the `asmdef` file in the project browser, in the `platforms` list do you see the `Editor` platform checked?

    Best,
    Ethan
     
  4. z000z

    z000z

    Joined:
    Dec 31, 2014
    Posts:
    96
    Ah ok, I was using the "Any" platform selection, If I change it to just Editor that appears to still work and fix the issue, thanks!