Addressable Path to copy assets

Hi, I’ve got a shell script running which is meant to copy the compiled updated Addressable assets and upload them to S3. My script was working but in Cloud Build it can no longer seem to find the compiled Addressable assets in the Post Build.

I was using the details provided in the “Copying Addressables content with a post-build script” section here: Unity Build Automation

Could you tell me if the path has changed or if I am missing something?

# set the path based on the first argument
path="${WORKSPACE}/.build/last/${BUILD_TARGET}/extra_data/addrs/"

# loop through the folder path and upload each file
for f in "$path"/*
do
    # get the file
    file="${f##*/}"

    # build the file path
    filePath="$path/$file"

    echo "Uploading File: $file"
// $file is .../.build/last/iOS/extra_data/addrs//*
done

Did you update your version of Unity or the Addressables package? As far as I know, nothing has changed on our side - particularly due to the code freeze over the holiday period.

Nope, I don’t think I have. The path seems to have changed to: {WORKSPACE}/.build/last/{BUILD_TARGET}/extra_data/addrs/ServerData/iOS

Adding on ServerData/iOS to the path

From taking a quick look it seems as if this change was triggered by switching to Xcode 12.2.0 in your new project - I guess that’s not entirely surprising though it is a little confusing and frustrating. I’ll talk to the Addressables and Documentation team about this.

Ah interesting, thanks for letting me know the reason. Is there an environment variable that points to the Addressable content path?

Not currently, no. Although in this case it wouldn’t really help since the only part we control is the /extra_data/addrs part, the extra stuff on the end is being added by processes outside of our direct control and we’re just using **/* to pick up those files for upload anyway.

Are the Addressable not compiled with the Unity compiler? The addressable path for Android is the same structure:
{WORKSPACE}/.build/last/{BUILD_TARGET}/extra_data/addrs/ServerData/Android

The Unity compiler is only a small part of the UCB build process and it’s the part which we don’t have direct control over since it’s reliant on which Unity version and Addressables package you are using. We do have some improvements planned for how we structure the build process and artifact manifest but it will probably be several months before those are available.

Cool thanks for clearing it up.

What were you comparing against, actually? I just had a look at your projects and as far as I can see your projects have always copied the addressables data into subfolders of the extra_data/addrs path. As well as the ServerData there’s also the Library folder in there which stores your content state.

Is was originally developed for use in a Guest Project it could have been that it was using Unity 2020.x instead of 2019.