Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
avatar image
0
Question by Ricna · Mar 13, 2016 at 01:03 AM · unity 5error messageassetbundlebuildassetbundle

BuildAssetBundles() error: An abnormal situation has occurred: the PlayerLoop internal function has been called recursively.

I'm trying to update my code to use the new method to create AssetBundles. Unfortunately by script I'm not having success.

     private IEnumerator BuildAssetBundleNew() {
         string[] assetPaths = AssetDatabase.GetAllAssetPaths();
         for (int i = 0; i < assetPaths.Length; i++) {
             AssetDatabase.Refresh();
             yield return new WaitForSeconds(1f);
             if ((assetPaths[i].Contains("Materials") == false) &&
                     (
                         assetPaths[i].Contains("Assets/Resources/OBJ/")
                         || assetPaths[i].Contains("Assets/Resources/Textures/")
                         || assetPaths[i].Contains("Assets/Resources/PrefabColliders/")
                     )
                 ) {
 
                 UnityEngine.Object[] assets = AssetDatabase.LoadAllAssetsAtPath(assetPaths[i]);
 
                 //------------------------------------------------/*
                 //BUILD MAP
                 AssetBundleBuild[] buildMap = new AssetBundleBuild[1];
                 buildMap[0] = new AssetBundleBuild();
                 buildMap[0].assetBundleName = assets[0].name + ".unity3d5";
                 string[] assetsToBuild = new string[1];
                 assetsToBuild[0] = assetPaths[i];
                 buildMap[0].assetNames = assetsToBuild;
  
                 //------------------------------------------------*/
                 AddBuildMap(buildMap);
                 qtAbFiles++;
             }
         }
         yield return StartCoroutine(BuildAllAssetsFromBuildMap());
         yield return new WaitForSeconds(1.0f);
         EncryptAssetBundles();
     }
     //----------------------------------------------------------
     private AssetBundleBuild[] finalBuildMap;
     private void AddBuildMap(AssetBundleBuild[] buildMap) {
         AssetBundleBuild[] aux = finalBuildMap;
         finalBuildMap = new AssetBundleBuild[qtAbFiles+1];
         Debug.Log("qtAbFiles" + qtAbFiles);
         if (qtAbFiles == 0) {
             finalBuildMap[0] = new AssetBundleBuild();
             finalBuildMap[0] = buildMap[0];
         } else {
             for (int i = 0; i < qtAbFiles; i++) {
                 finalBuildMap[i] = new AssetBundleBuild();
                 finalBuildMap[i] = aux[i];
              }
              finalBuildMap[qtAbFiles] = buildMap[0];
         }
     }
 
     //----------------------------------------------------------
     private IEnumerator BuildAllAssetsFromBuildMap() {
         yield return null;
         BuildPipeline.BuildAssetBundles("Assets/Resources/AssetBundle/", finalBuildMap);
     }
     //----------------------------------------------------------
 

The error occurs in the "BuildPipeline.BuildAssetBundles("Assets/Resources/AssetBundle/", finalBuildMap);" line BUT all AssetBundles are created... The problem is that script stop to work and the next method is not called.

I tried a lot of ways to create an AssetBundle using this new method, but always I'm getting this error:

"An abnormal situation has occurred: the PlayerLoop internal function has been called recursively. Please contact Customer Support with a sample project so that we can reproduce the problem and troubleshoot it. UnityEditor.BuildPipeline:BuildAssetBundles(String, AssetBundleBuild[]) c__Iterator5:MoveNext() (at Assets/Scripts/NMABuilder.cs:352)"

NOTE: In this case was created 4 AssetBundles, so the Iterator5:MoveNext could be some valuable information.

Thanks in advance!

Comment
Add comment
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

0 Replies

· Add your reply
  • Sort: 

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.

Follow this Question

Answers Answers and Comments

63 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

Related Questions

No AssetBundle.mainAsset with BuildingAssetBundles in 5.x ? 2 Answers

Errors When Making a New Unity5 3d Project 1 Answer

Strange Repetitive Error 0 Answers

unity unable to convert to dex format, need help fast. 0 Answers

Does New AssetBundle Build System in Unity 5 require separate packages for separate platforms 1 Answer


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