Log in or register to post comments

Scene swapping prompts strange error

May 23, 2013 - 12:51am #1

Hi,

I've been using the Qualcomm Augmented Reality Plugin for Unity and it's working great.

However, I get this strange error when I try to load a different scene, from the scene with the ARCamera and ImageTracker.

 

It looks like this:

state.object->ShouldIgnoreInGarbageDependencyTracking() == !doesClassIDHaveReferences

!state.object->ShouldIgnoreInGarbageDependencyTracking()
 
 
 
I built a fresh Unity project using the video tutorial and markers provided (with the minimalist of components) to confirm it wasn't an issue with other assets in my original project. Error persists.
 
Essentially, all I'm doing is clicking on the 3D object that appears on the marker which immediately loads a new scene. Simply: Application.LoadLevel("Scene 2").
 
The project still runs after the error, however, if I return to the AR scene, it won't track anymore.
 
 
My question is: do I need to manually destroy/disable all the AR components to avoid this strange error?
 
I tried disabling the tracking script, but the error remained. I also couldn't manage to destroy the ARCamera itself as it gave dependancy errors.
 
 
Any ideas are greatly appreciated.
 
Some specs:
Unity 4.1.2 on Mac OS X
Vuforia android-ios package 2.0.32

 

Scene swapping prompts strange error

July 25, 2013 - 5:11am #14

Hi NalinS,

We didn't test on the new release, we will try it later today and keep you posted !

We have downgraded our project to Unity 3.5 (I mean, export packages and recreate from scratch all scenes.. :( ..

But we think it's the best approach right now, it will take us a day of refactoring but at least it works :) 

 

Greetings,

Anthony

Scene swapping prompts strange error

July 25, 2013 - 3:57am #13

Have you tried it with the latest version of Unity 4.2.0f4 just released?

 

N

Scene swapping prompts strange error

July 25, 2013 - 3:39am #12

Hello guys,

We have exactly the same issue with vuforia and unity 4.1.2. Same error and the application is running out of memory after X times of switching between scenes. We can't find a way to fix this error but we are almost sure this error is involved in the fact that the app is running out of memory. (probably AR stuff not destroyed correctly while switching scenes..) 

Did you found some trick or fix for this issue? Or do we have to downgrade our Unity project (which will be really painful I think.. )

Thanks a lot for any help on this !

Regards,

Anthony

Scene swapping prompts strange error

June 26, 2013 - 5:57am #11

@jasmith

I have also crashes with Android devices (but not on iOS devices which sometimes have less memory). Maybe we can collect possibilities that reduce the memory issues in android?

Scene swapping prompts strange error

June 25, 2013 - 7:12pm #10

just what update?  QCAR SDK?  or Unity3d?

 

Scene swapping prompts strange error

June 4, 2013 - 7:29pm #9

Just an update.  It turns out I was given incorrect information about the how the functionality was working.  Turns out everything seems to be working fine.  The perils of being 1000 miles away from the boss heh :)

Thanks

-Mo

Scene swapping prompts strange error

June 3, 2013 - 6:15pm #8

Hi Nalin,

Sorry to clarify, I could go back and forth between scenes with iOS, but only when I upgraded to Unity 4.1.3.

In Unity 4.1.2, I couldn't get the AR going again after the first scene swap on iOS.

In Unity 4.1.3, the AR was functional across iOS and Android when swapping scenes.

Though my immediate issue right now is that on Android, the app seems to crash after switching between the regular and the AR scene after x number of times. The phone also gets quite hot, and my best guess is that it's running out of memory. Is it possible that with each time I return to the AR scene, more memory is being allocated but not properly garbage collected when I leave the scene? I have a suspicion that the strange error is somehow involved.

Scene swapping prompts strange error

June 3, 2013 - 3:17pm #7

Hello there.  I'm glad this thread is going because I'm having the same error.  

However, this is in my own project, not any samples, and I've checked through the code and there are no calls at all to Resources.UnloadUnusedAssets();

Is there anything else that could be causing the error?  On our iOS devices the AR works well for the most part but switching between scenes has caused

some strange inconsistencies (models not showing up properly, wrong orientation, etc).  

Is there another way to get rid of that error?  I always get nervous with errors, even if they're not supposed to cause any problems.

Thank you!  So far I have to say working with this stuff has been great :)

-Mo

 

Scene swapping prompts strange error

June 3, 2013 - 4:03am #6

The code I tried below was with iOS, so I was able to go back and forth without issue.

Can you try that sample code on iOS to see whether it works ok for you in that instance?

 

N

Scene swapping prompts strange error

June 2, 2013 - 4:10pm #5

Hi,

Sorry, to be more specific, I only had problems returning to the AR scene when publishing to iOS devices. I could continue using the AR when testing on desktop or deploying to Android with the error present. Though that was in Unity 4.1.2.

In Unity 4.1.3, the AR scene seems fine on ALL devices with the error still present when switching back and forth.

However I'm a little worried about my testing on Android, because the app seems to crash after returning to the AR scene for the 5th or 6th time (this number varies). And I'm not sure if it's related, or a different problem entirely.

Scene swapping prompts strange error

May 28, 2013 - 4:04am #4

would that line of code (Resources.UnloadUnusedAssets()) be somewhere within the Qualcomm Augmented Reality scripts attached to the ARCamera?

That line is in the LoadingManager script which is in LoadingScene scene and is attached to a LoadingManager gameobject.  It is used before it loads the AR scene:

 

    /// Loads the ImageTargets scene.

    private void LoadImageTargetsScene()

    {

        Application.LoadLevelAsync("Vuforia-4-ImageTargets");

    }

 

It is hard to say exactly what to do here, so to test it I was able to take the basic Image Targets sample and add a back button to the AR scene by adding the following to the ImageTargetsMenu.cs (line 244): 

 

    if(GUI.Button(new Rect(0, Screen.height/2 + 120, Screen.width,114),"Back", itemButtonStyle)){

                    

        Application.LoadLevel("Vuforia-2-AboutScreen");

    }

 

When running I was able to go back and forth between the various scenes and the AR seemed to work fine.  Although I did see the same error, it seemed harmelss and did not affect the functionality.

I am hoping that you can apply something from this to circumvent the problem you are seeing.

Please keep me posted.

 

N

Scene swapping prompts strange error

May 26, 2013 - 5:36pm #3

Hi,

Thanks for your reply. That certainly seems to be the case. I recently updated to Unity 4.1.3 in a hope that the issue was fixed, but the error remains.

Yes, I'm only using Application.LoadLevel() to switch between the two test scenes: one with the ARCamera and ImageTarget, and the other with a simple button to return to the AR scene.

The error prompts each time I move between scenes after leaving the AR scene.

Referring to the Unity forum link, would that line of code (Resources.UnloadUnusedAssets()) be somewhere within the Qualcomm Augmented Reality scripts attached to the ARCamera? And if so, should I manually remove it and/or replace it with something else as a temporary hotfix? Only because I can't see an immediate resolution to this strange error, and I'd like to at least, circumvent the problem reasonably soon for an upcoming project.

I can't say whether this issue was present in previous versions of Unity as I've only used 4.1.2+. I can only assume it wasn't, as I can't find a single past post with an issue similar to mine.

 

Scene swapping prompts strange error

May 24, 2013 - 2:44am #2

Hi jasmith,

This could be a Unity issue related to version 4.1.2:

http://answers.unity3d.com/questions/435614/what-does-error-shouldignoreingarbagedependencytra.html

 

Changing scenes should work, but the datasets will not be preserved if this is between AR Scenes.

 

The project still runs after the error, however, if I return to the AR scene, it won't track anymore.

When you return to the ARScene are you doing this using Application.LoadLevel() again?  

Was this working in a previous version of Unity?

 

N

 

Log in or register to post comments