Search Unity

Localization - works well if locally built, but when the build is built via CI - No Locales...

Discussion in 'Localization Tools' started by Andriy-Zimbitskyy, Dec 22, 2021.

  1. Andriy-Zimbitskyy

    Andriy-Zimbitskyy

    Joined:
    Mar 26, 2015
    Posts:
    6
    Hello! Our team uses CI to build the project on GitLab. We added Localization - it works well in the locally built build. But after building on Gitlab we have this issue:
    Invalid path in TextDataProvider : D:/.../StreamingAssets/aa/settings.json'.
    Can somebody help, please?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Did you build the addressable assets on the ci build? You will likely need to do it with a script that runs before the build step.
     
    Andriy-Zimbitskyy likes this.
  3. Andriy-Zimbitskyy

    Andriy-Zimbitskyy

    Joined:
    Mar 26, 2015
    Posts:
    6
    Thanks for the quick reply, we will try it.
     
    karl_jones likes this.
  4. Andriy-Zimbitskyy

    Andriy-Zimbitskyy

    Joined:
    Mar 26, 2015
    Posts:
    6
    Is it enough to call
    AddressableAssetSettings.CleanPlayerContent();
    AddressableAssetSettings.BuildPlayerContent();
    in my Buid() method?
    @karl_jones
     
    Last edited: Dec 24, 2021
    karl_jones likes this.
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Yes thats fine
     
    Andriy-Zimbitskyy likes this.
  6. Andriy-Zimbitskyy

    Andriy-Zimbitskyy

    Joined:
    Mar 26, 2015
    Posts:
    6
    @karl_jones
    I added
    AddressableAssetSettings.CleanPlayerContent();
    AddressableAssetSettings.BuildPlayerContent();
    to our Buid() method
    But still, the problem persists - locally built - works well, remotely built - gives an issue
    (System.Exception: Invalid path in TextDataProvider : 'D:/.../StreamingAssets/aa/settings.json'.)
    Maybe I should work with a custom path here?
    Path.png
     
    Last edited: Dec 24, 2021
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Are you using the latest addressables package?
     
  8. Andriy-Zimbitskyy

    Andriy-Zimbitskyy

    Joined:
    Mar 26, 2015
    Posts:
    6
    Yes, we use the latest version of addressable. (and Unity 2021.1.7f1)
    I am confused by this build local path: Library/com.unity.addressables/aa/Windows/StandaloneWindows64
    Because we don't upload the "Library" folder - it is in .gitignore, as usually
     

    Attached Files:

    Last edited: Dec 25, 2021
  9. Andriy-Zimbitskyy

    Andriy-Zimbitskyy

    Joined:
    Mar 26, 2015
    Posts:
    6
    Solved.
    The Labels - that was the problem!
    Thanks!
     
    unity_5URtXbavzxV4wA likes this.
  10. unity_5URtXbavzxV4wA

    unity_5URtXbavzxV4wA

    Joined:
    Apr 29, 2020
    Posts:
    1
    Thank you !
    I had the same issue and it was because the "StreamingAssets" folder was never created on CI Build (it worked fine in the local build)
    To resolve the issue, I added this code before calling the Build method :
    - AddressableAssetSettings.CleanPlayerContent();
    - AddressableAssetSettings.BuildPlayerContent();

    AND I added the label "default" instead of empty for all my addressables.
    However, I don't know why labels needs to be "default", maybe it's related to my Unity or addressables version.
    I'm using Unity 2022.2.17 with Addressables 1.21.17.
     
    karl_jones likes this.
  11. cprenoveau_illogika

    cprenoveau_illogika

    Joined:
    Jul 20, 2022
    Posts:
    1
    To add to what my coworker just said, because I can't wrap my head around this strange issue:

    Building locally in batch mode works properly but somehow, running the same command in a GitLab CI job running in a Docker causes addressables to fail to build when labels are left blank. It makes no sense to me. There's something we must have missed. I'll post the error in case someone else is googling it:

    SocketException: Access denied
    Asset Pipeline Refresh: Total: 0.164 seconds - Initiated by RefreshV2(NoUpdateAssetOptions)
    DisplayProgressbar: Processing Addressable Group
    InvalidOperationException: Unable to build with the current configuration, please check the Build Settings.
    SBP ErrorException
    Addressable content build failure
     
  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Is there any more to the error message? Does it say what's wrong with the configuration?