Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Official Loadable Plugin Directory import behaviour change (androidlib, .bundle, .framework, and .plugin)

Discussion in '2023.1 Beta' started by Unity_Javier, Jan 2, 2023.

  1. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hello everyone,

    From Unity 2023.1.0a24 onwards a behaviour change to how Unity handles loadable plugin directories has been introduced.

    Previously, when importing directories of types .androidlib, .bundle, .framework, and .plugin, .meta files would be created for each asset or directory within them. This caused lots of headaches as it resulted in the introduction of unexpected files into those folders, and multiple workarounds have been implemented in order to remove them for final builds and store submissions.

    To address this issue, we have modified the Editor code such that the creation of .meta files in loadable plugin directories is prevented.
    Additionally, if those directories already have .meta files in them, the .meta files are ignored when making a game build. We decided on that instead of deleting the files in an upgrade step as that would cause unnecessary version control noise when opening the Editor.

    We have tested this behaviour change and have confirmed that the following actions will now work as expected:

    1. Disallowing drag and drop into loadable plugin directories (for single or multiple asset selections)
    2. Not showing plugin folders as folders in the project browser (both one and two column views)
    3. Handling DirectoryMonitor messages correctly when deleting an already existing .meta file in a plugin folder (Windows only)
    4. Importing folders named "bundle", "framework", etc. while still allowing assets to be moved into them
    5. Moving loadable plugin folders to another non-loadable plugin directory without importing any of its contents
    6. Reimporting parent folders of loadable plugin directories without importing the contents of the loadable plugin directories
    7. Double clicking loadable plugin directories will open the directory in Finder/Explorer depending on your OS


    We hope that this behaviour change will streamline the import process for you all and reduce the number of manual tweaks needed to ship a game. Let us know if you have any questions or concerns.
     
  2. aras-p

    aras-p

    Joined:
    Feb 17, 2022
    Posts:
    75
    I have one piece of feedback... and that is "nice!"
     
    vx4, AlkisFortuneFish, echu33 and 2 others like this.
  3. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    516
    Agreed. This is a good fix.

    I do hope to expand on this and detect if a folder is marked as Bundle in macOS, so that in case a Bundle is not named in one of the extensions named in the post. I think doing so would be future-proof, although I’m not sure how practical it is.
     
  4. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
  5. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    There is a planned feature, where you could specify which folders and Assets not to import. Its still being planned out though, but it has an overlap with the loadable plugin directory change we just did.
     
    mariandev and mahdi_jeddi like this.
  6. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    I know it is not related to this directly, but how about StreamingAssets folder? I think same idea can be applied to it. Currently StreamingAsests folder has redundant meta files (in editor only of course) and importing processes.
     
    Peter77 likes this.
  7. robspsj

    robspsj

    Joined:
    Jan 10, 2023
    Posts:
    1
    hey, is there a way to revert this behaviour in settings?

    i know that it may be a little https://xkcd.com/1172/

    i'm updating a project from an older unity version to 2022.3 now that it is lts. but i have a custom build script that change the contents of a file inside a .res folder depending on some parameter

    now i cant reference the desired file inside my scriptable object anymore, since the meta files inside .androidlib are being ignored
     
  8. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hi @robspsj ,

    I think this is gonna be a bit tricky to do, since we didn't build an "escape hatch" for this behaviour change. That being said, maybe something could be done to improve your situation.

    In theory you could do the following to get around this problem:
    1. Figure out where the file in question is located using a combination of Unity & C# APIs
    - i.e. Find where the .androidlib is, then do something like:

    Code (CSharp):
    1. var options = new EnumerationOptions();
    2.         options.RecurseSubdirectories = true;
    3.         System.IO.Directory.EnumerateFiles("Assets/FolderWithAndroidLib", "*.*", options);
    2. Create a new folder, something like "Assets/MyResFileWorkaround"
    3. Create a symlink inside "MyResFileWorkaround", which links to the file inside the .res folder
    - i.e. "Assets/MyResFileWorkarond/my_symlinked_file.some_ext"
    4. Update the reference from your scriptable object to the symlink

    I think this should work, though I have not tried it yet.

    Is this specific to your machine only, or are there other people in your project? I'm asking, because the symlink is machine specific, so you might have to make a script that automates all of this if it works locally.
     
    LeonhardP likes this.
  9. umarhyatt

    umarhyatt

    Joined:
    Nov 20, 2020
    Posts:
    6
    what's if we export .androidlib file from plugin folder with unity latest version but when i import that exported file at this time file not import and not showing in plugin how you can handle it kindly explain.
     

    Attached Files:

  10. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
    We have landed a fix that allows plugin folders to be exported in 2023.3.0b4. The back ports to 2022.3 and 2021.3 are in progress too.