使用Addressable加载远程AB资源时报错

使用Addressable加载远程AB资源时报错_第1张图片

Insecure connection not allowed
UnityEngine.AddressableAssets.Addressables:LoadAssetAsync (object)
AddressableManager:LoadAssetAsync (string) (at Assets/Scripts/AddressableManager/AddressableManager.cs:38)
Test/d__2:MoveNext () (at Assets/Scripts/Test/Test.cs:28)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
Test:Start () (at Assets/Scripts/Test/Test.cs:13)

System.NullReferenceException: Object reference not set to an instance of an object
  at UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider+InternalOp.SendWebRequest (System.String path) [0x00083] in .\Library\PackageCache\[email protected]\Runtime\ResourceManager\ResourceProviders\TextDataProvider.cs:169 
  at UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider+InternalOp.Start (UnityEngine.ResourceManagement.ResourceProviders.ProvideHandle provideHandle, UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider rawProvider) [0x000b1] in .\Library\PackageCache\[email protected]\Runtime\ResourceManager\ResourceProviders\TextDataProvider.cs:61 
  at UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider.Provide (UnityEngine.ResourceManagement.ResourceProviders.ProvideHandle provideHandle) [0x00001] in .\Library\PackageCache\[email protected]\Runtime\ResourceManager\ResourceProviders\TextDataProvider.cs:202 
  at UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation`1[TObject].Execute () [0x00070] in .\Library\PackageCache\[email protected]\Runtime\ResourceManager\AsyncOperations\ProviderOperation.cs:244 
UnityEngine.AddressableAssets.Addressables:LoadAssetAsync (object)
AddressableManager:LoadAssetAsync (string) (at Assets/Scripts/AddressableManager/AddressableManager.cs:38)
Test/d__2:MoveNext () (at Assets/Scripts/Test/Test.cs:28)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
Test:Start () (at Assets/Scripts/Test/Test.cs:13)

Insecure connection not allowed
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass60_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.AddressableAssets.Initialization.InitializationOperation/<>c__DisplayClass18_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:29)

RemoteProviderException : Unable to load asset bundle from : http://192.168.2.2:8080/StandaloneWindows64/defaultlocalgroup_assets_all_4762054ac9df9665375cffe9479a1060.bundle
UnityWebRequest result : ConnectionError : Insecure connection not allowed
url : http://192.168.2.2:8080/StandaloneWindows64/defaultlocalgroup_assets_all_4762054ac9df9665375cffe9479a1060.bundle


UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass60_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.AddressableAssets.Initialization.InitializationOperation/<>c__DisplayClass18_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:29)

Insecure connection not allowed
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass60_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.AddressableAssets.Initialization.InitializationOperation/<>c__DisplayClass18_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:29)

RemoteProviderException : Unable to load asset bundle from : http://192.168.2.2:8080/StandaloneWindows64/574e26f9993060115a357ffddd6bec76_unitybuiltinshaders_644aca7cadefe9f1907c7e4094536ffd.bundle
UnityWebRequest result : ConnectionError : Insecure connection not allowed
url : http://192.168.2.2:8080/StandaloneWindows64/574e26f9993060115a357ffddd6bec76_unitybuiltinshaders_644aca7cadefe9f1907c7e4094536ffd.bundle


UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass60_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.AddressableAssets.Initialization.InitializationOperation/<>c__DisplayClass18_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:29)

OperationException : GroupOperation failed because one of its dependencies failed
RemoteProviderException : Unable to load asset bundle from : http://192.168.2.2:8080/StandaloneWindows64/defaultlocalgroup_assets_all_4762054ac9df9665375cffe9479a1060.bundle
UnityWebRequest result : ConnectionError : Insecure connection not allowed
url : http://192.168.2.2:8080/StandaloneWindows64/defaultlocalgroup_assets_all_4762054ac9df9665375cffe9479a1060.bundle


UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass60_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.AddressableAssets.Initialization.InitializationOperation/<>c__DisplayClass18_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:29)

System.Exception: Dependency Exception ---> UnityEngine.ResourceManagement.Exceptions.OperationException: GroupOperation failed because one of its dependencies failed ---> UnityEngine.ResourceManagement.Exceptions.RemoteProviderException: RemoteProviderException : Unable to load asset bundle from : http://192.168.2.2:8080/StandaloneWindows64/defaultlocalgroup_assets_all_4762054ac9df9665375cffe9479a1060.bundle
UnityWebRequest result : ConnectionError : Insecure connection not allowed
url : http://192.168.2.2:8080/StandaloneWindows64/defaultlocalgroup_assets_all_4762054ac9df9665375cffe9479a1060.bundle


   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass60_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.AddressableAssets.Initialization.InitializationOperation/<>c__DisplayClass18_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:29)

OperationException : ChainOperation failed because dependent operation failed
System.Exception: Dependency Exception ---> UnityEngine.ResourceManagement.Exceptions.OperationException: GroupOperation failed because one of its dependencies failed ---> UnityEngine.ResourceManagement.Exceptions.RemoteProviderException: RemoteProviderException : Unable to load asset bundle from : http://192.168.2.2:8080/StandaloneWindows64/defaultlocalgroup_assets_all_4762054ac9df9665375cffe9479a1060.bundle
UnityWebRequest result : ConnectionError : Insecure connection not allowed
url : http://192.168.2.2:8080/StandaloneWindows64/defaultlocalgroup_assets_all_4762054ac9df9665375cffe9479a1060.bundle


   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
UnityEngine.ResourceManagement.ChainOperationTypelessDepedency`1:OnWrappedCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)
DelegateList`1>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at ./Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:29)


解决方法:

将Edit -> Project Settings -> Player -> Other Settings ->Configuration ->Allow downloads over HTTP改为允许

使用Addressable加载远程AB资源时报错_第2张图片

你可能感兴趣的:(Unity3D,Addressable,unity,Addressable)