• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by Shinkaze33 · Apr 26, 2019 at 06:42 AM · error messageasset storeoculusimporting assets

Why am I getting "AssetImporter is referencing an asset from the previous import..."?

Why am I getting this error?

ERROR [11:55:19] AssetImporter is referencing an asset from the previous import. This should not happen.

This occurs on a brand new 3D project in Unity 2018.3.10f1 when the only action I take after opening the project for the first time is to import the Oculus Unity Integration asset. (located here) via the asset store.

https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022

Why am I getting this error and what are the steps to resolve?

Thank you, -Adam

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Shinkaze33 · Apr 25, 2019 at 07:18 PM 0
Share

This occurs on Step 3 of the following instructions.

https://developer.oculus.com/documentation/unity/latest/concepts/unity-import/

2 Replies

· Add your reply
  • Sort: 
avatar image
7

Answer by Martinch01 · Jun 04, 2019 at 03:19 PM

Hi @Shinkaze33 ,

The error you are seeing is due to an asset having a broken reference to itself. The issue can be fixed by reserializing the problematic assets. In this case it's:

 \Assets\Oculus\SampleFramework\Core\CustomHands\Animations\r_hand_relax_3qtr_fist_anim.fbx


Unfortunately, reserializing can be done only through script, so I've attached a simple script that you can add in your Assets/Editor folder (you can create it if it doesn't exist) and it will add an option to "Force Reserialize" when you right click the assets in the editor.

 using UnityEditor;
 using UnityEngine;
 
 [CreateAssetMenu()]
 public class PrefabReferenceFixer : ScriptableObject
 {
     [MenuItem("Assets/Force Reserialize")]
     private static void ForceReserialize()
     {
         GameObject[] selection = Selection.gameObjects;
         string[] objectPaths = new string[selection.Length];
 
         for(int i = 0; i < selection.Length; ++i)
         {
             objectPaths[i] = AssetDatabase.GetAssetPath(selection[i]);
         }
 
         AssetDatabase.ForceReserializeAssets(objectPaths);
     }
 }


You can either reserialize the specific asset, or the whole Oculus folder. That should get rid of the error for you.

Thanks,
Martin

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image stuck_cow · Aug 01, 2019 at 02:40 PM 0
Share

Thank you for your answer, this fixed the problem for me!

avatar image HoloSon · Aug 02, 2019 at 10:01 PM 0
Share

This script doesn't seem to be doing anything for me. I'm having the exact same issue with the exact same Unity version. I created an Assets/Editor folder, created a PrefabReferenceFixer script, pasted your code, right clicked the Oculus folder, clicked "Force Reserialize". Nothing happened and the error is still there...

Did I do something wrong? Is there an Option I should enable?

@stuck_cow Did you do anything else different?

avatar image Earthshine · Nov 11, 2020 at 04:41 PM 0
Share

I had an error with one of my prefabs:

Asset import did not unload metadata path. This will leak memory. File a bug with repro steps please. [Prefab Name] UnityEditor.PrefabImporterEditor:OnDestroy()

and your script solved the problem. Thank you, $$anonymous$$artin.

avatar image
0

Answer by learn2burn13 · May 17, 2021 at 07:36 AM

I was having the same issue. Reserializing didn't help, but I found the solution.

The solution: Posted by kubajs, here: https://forum.unity.com/threads/assetimporter-is-referencing-an-asset-from-the-previous-import-this-should-not-happen.568147/

I was able to fix the issue by moving the prefab to the hierarchy temporarily, setting the reference in the hierarchy and applying the prefab changes.

My knowledge of the correct terms to use is poor, so apologies in advance. The steps I used:

  1. Drag prefab into scene, to create as object

  2. In the new object, drag drop the prefab to the inspector's reference (i.e. public GameObject ...)

  3. At top of inspector, just below "layers" there's a dropdown with text "overrides"; click that and select "apply all". This will apply the changes to the prefab.

    Note: the object in scene shows this reference as a prefab (blue box), but the prefab shows a regular object (grey box).

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

178 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

,Cannot Enter Play Mode when I download assets from assets store 1 Answer

when i want to use grasses in sun temple asset i face an error , what should i do ???? i cant use grasses in large amount 0 Answers

Asset Store Connection timed out with proxy 3 Answers

Can't import asset from Asset Store 0 Answers

Why am I getting the error "user does not have app in library" when I do the Entitlement Check? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges