Search Unity

FileNotFoundException when CreateLocator is run on Android device when using custom providers

Discussion in 'Addressables' started by tictocblake, Jul 17, 2019.

  1. tictocblake

    tictocblake

    Joined:
    Apr 10, 2018
    Posts:
    6
    Hi,

    I'm a bit new to extending the build pipeline, so if I've made some novice mistake, forgive me.

    I've jumped in head first with addressables, and I've build two custom provides, one which extends
    ResourceProviderBase and the other extends BundledAssetProvider. They are used to consume bundles stored on Playfab.

    When running in 'Packed Play Mode' everything runs correctly, my custom providers are used and instantiating prefabs stored in the bundles works like a charm. When I build to android and run, the logs show that the default providers get added, then I get the following exception, which results in the prefab being unable to be instantiated (there are other exceptions regarding that a few logs later, but I'm assuming this is the root cause:

    Code (CSharp):
    1. FileNotFoundException: Could not load file or assembly 'Assembly-CSharp-Editor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies
    2. System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity, System.Boolean refonly) (at <00000000000000000000000000000000>:0)
    3. UnityEngine.ResourceManagement.Util.LRUCacheAllocationStrategy.Release (System.Int32 typeHash, System.Object obj) (at <00000000000000000000000000000000>:0)
    4. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData.CreateLocator (System.String providerSuffix) (at <00000000000000000000000000000000>:0)
    5. UnityEngine.AddressableAssets.Initialization.InitializationOperation.OnCatalogDataLoaded (UnityEngine.AddressableAssets.AddressablesImpl addressables, UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] op, System.String providerSuffix) (at <00000000000000000000000000000000>:0)
    6. System.Func`2[T,TResult].Invoke (T arg) (at <00000000000000000000000000000000>:0)
    7. UnityEngine.ResourceManagement.ChainOperation`2[TObject,TObjectDependency].Execute () (at <00000000000000000000000000000000>:0)
    8. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeExecute () (at <00000000000000000000000000000000>:0)
    9. DelegateList`1[T].Invoke (T res) (at <00000000000000000000000000000000>:0)
    10. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeCompletionEvent () (at <00000000000000000000000000000000>:0)
    11. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].Complete (TObject result, System.Boolean success, System.String errorMsg) (at <00000000000000000000000000000000>:0)
    12. UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation`1[TObject].ProviderCompleted[T] (T result, System.Boolean status, System.Exception e) (at <00000000000000000000000000000000>:0)
    13. UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider+InternalOp.OnCatalogLoaded (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] op) (at <00000000000000000000000000000000>:0)
    14. DelegateList`1[T].Invoke (T res) (at <00000000000000000000000000000000>:0)
    15. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeCompletionEvent () (at <00000000000000000000000000000000>:0)
    16. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].Complete (TObject result, System.Boolean success, System.String errorMsg) (at <00000000000000000000000000000000>:0)
    17. UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation`1[TObject].ProviderCompleted[T] (T result, System.Boolean status, System.Exception e) (at <00000000000000000000000000000000>:0)
    18. UnityEngine.AsyncOperation.InvokeCompletionEvent () (at <00000000000000000000000000000000>:0)
    19. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeExecute()
    20. DelegateList`1:Invoke(T)
    21. UnityEngine.AddressableAssets.ResourceProviders.InternalOp:OnCatalogLoaded(AsyncOperationHandle`1)
    22. DelegateList`1:Invoke(T)
    23. UnityEngine.AsyncOperation:InvokeCompletionEvent()
    With the callout for the CSharp-Editor I verified that the UnityEditor isn't trying to be included at the top of the file that contains my providers, these are the only present usings
    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using UnityEngine.ResourceManagement.ResourceLocations;
    4. using UnityEngine.ResourceManagement.ResourceProviders;
    And it is not in an Editor folder.

    Any tips or suggestions? Has anyone else seen this?

    Thanks!
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
  3. tictocblake

    tictocblake

    Joined:
    Apr 10, 2018
    Posts:
    6
    @unity_bill I have attempted to upload three times, but I get an error at the end:
    I'm not sure if it's succeeded on the upload or not, if it's not working, I can try to make a smaller more isolated project to upload.
     
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    I've managed to create a repro myself finally based on that other thread. So don't worry about making the bug in this case.
     
    tictocblake likes this.
  5. tictocblake

    tictocblake

    Joined:
    Apr 10, 2018
    Posts:
    6
    awesome, thank you unity_bill :)