Search Unity

Asset bundles showing pink using new URP

Discussion in 'Asset Bundles' started by Chico3001, Nov 16, 2020.

  1. Chico3001

    Chico3001

    Joined:
    Mar 10, 2018
    Posts:
    8
    I have 2 projects and upgraded them to Unity 2020.1.13 using AR Foundation 4.0.9, AR Core 4.0.9, and Universal RP 8.2.0

    Then i just change the settings on both projects to use the new Universal RP using this tutorial



    On one project i just create asset bundles to upload them to my server, the other is an AR Core app that downloads them and puts them on scene, but now all my asset bundles are pink

    I upgraded the materials on the first project, rebuild the Asset Bundle and upload it to the server, it stills shows it pink

    My asset instantiator on the App is pretty straightfoward:

    Code (CSharp):
    1. using (UnityWebRequest ww2 = UnityWebRequestAssetBundle.GetAssetBundle(asset["file_android"], (uint)asset["version"], 0))
    2.     {
    3.         operation = ww2.SendWebRequest();
    4.  
    5.         while (!operation.isDone)
    6.         {
    7.             yield return null;
    8.         }
    9.  
    10.         if (ww2.isNetworkError || ww2.isHttpError)
    11.         {
    12.             Debug.Log(ww2.error);
    13.             Debug.Log(asset["url"]);
    14.         }
    15.         else
    16.         {
    17.             // Get downloaded asset bundle
    18.             AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(ww2);
    19.             Material[] materials = bundle.LoadAllAssets<Material>();
    20.             GameObject[] objects = bundle.LoadAllAssets<GameObject>();
    21.             // Sprite[] sprites = bundle.LoadAllAssets<Sprite>();
    22.             bundle.Unload(false);
    23.  
    24.             GameObject newObj = Instantiate(objects[0], transform);
    25.             newObj.transform.localScale = new Vector3(scaleFactor, scaleFactor, scaleFactor);
    26.         }
    27.     }
    28.  
    And my Asset Bundle Creator is just extracted from the manual:

    Code (CSharp):
    1. string folderName = "AssetBundles";
    2.     string filePath = Path.Combine(Application.streamingAssetsPath, folderName);
    3.     AssetBundleManifest asset = BuildPipeline.BuildAssetBundles(filePath, BuildAssetBundleOptions.None, BuildTarget.Android);
    4.  
    5.     AssetDatabase.Refresh();
    6.     string oldfn = filePath + "/" + asset.GetAllAssetBundles()[0];
    7.     string newfn = filePath + "/" + asset.GetAllAssetBundles()[0] + ".asset";
    8.     System.IO.File.Move(oldfn, newfn);
    9.     Debug.Log("Archivo Creado:" + newfn);
    10.     EditorUtility.RevealInFinder(newfn);
    11.  
    Any ideas on what can be happening?
     
  2. Vi-V-eK

    Vi-V-eK

    Joined:
    Jun 9, 2017
    Posts:
    11
    Having the same problem myself, unable to resolve it at the moment.
     
  3. vitaliano_fanatee

    vitaliano_fanatee

    Joined:
    Oct 9, 2020
    Posts:
    37
    I had the same problem before and the only solution I'd found was to add the shader into the "Aways included shaders" in the project settings.
     
    Vi-V-eK likes this.