Search Unity

Bug IN-40099 - XR Management Package >=4.3.1 deletes UnityLibrary AndroidManifest.xml

Discussion in 'AR' started by AlkisFortuneFish, May 3, 2023.

  1. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    FYI, versions of the XR Management Package >= 4.3.1 have introduced some very "interesting" code that deletes the AndroidManifest in OnPostprocessBuild.

    Code (CSharp):
    1.  
    2. public void OnPostprocessBuild(BuildReport report)
    3. {
    4.     // Always remember to cleanup preloaded assets after build to make sure we don't
    5.     // dirty later builds with assets that may not be needed or are out of date.
    6.     CleanOldSettings();
    7.  
    8.     // This is done to clean up XR-provider-specific manifest entries from Android builds when
    9.     // the incremental build system fails to rebuild the manifest, as there is currently
    10.     // (2023-09-27) no way to mark the manifest as "dirty."
    11.     CleanupAndroidManifest();
    12. }
    13.  
    This, of course, breaks all exported Android builds. It is an extremely misguided piece of code at many different levels. Please remove. We've worked around it by embedded the package and fixing it ourselves, but the list of packages where that has become necessary is growing.
     
  2. unity-chris

    unity-chris

    Unity Technologies

    Joined:
    Nov 10, 2022
    Posts:
    29
    Hi AlkisFortuneFish,

    We have fixed this issue and the solution will be released soon in the next version of XR Management Package. It will no longer use this code, which was used with the intention to clear cached manifests. Instead, the manifest changes will be done in a separate file, instead of using the Unity-generated manifest.

    Please reach out if you have other concerns.
     
  3. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    Great to hear that. Please ensure that the test suite for any version of this includes testing exported builds.
     
    unity-chris likes this.