Hi,
I'm running Unity 3.5.7f6 and the Vuforia plugin v2.5.8, and getting a crash that only seems to affect the Kindle Fire HD.
I'm using the QCARViewFinderTask code found here: https://developer.vuforia.com/resources/dev-guide/extending-unity-android-activity-and-adding-custom-views-eclipse to add Android UI elements to the QCARPlayerActivity
This works well and the AR Activity loads and runs without a hitch on an HTC One (Android 4.2.2), an HTC Desire HD (Android 2.3.7) and a Nexus 7 (Android 4.0.3), but on the Kindle Fire HD 7" (OS 7.4.6) the activity crashes.
Stepping through the code, it appears that qcarView in line 33 is getting set to null in findQCARView().
Looking at the children of rootView, there is only one, and it is a LinearLayout, whereas on the other devices, the only child is a QCARUnityPlayer (as it should be)
Does anyone know of any reason why this would be happening only on this one device, or any workarounds to this issue?
Thanks for your help
Crash on Kindle Fire HD
That's a bit weird; the only thing I can think of is a threading issue;
one thing you could try to use a Handler (use the post() method) instead of the Timer, so to execute the view search with some delay, see :
Crash on Kindle Fire HD
Crash on Kindle Fire HD
Do you see such a problem with our samples too ? or just on your custom application ?
Crash on Kindle Fire HD
Of course, that was the question I should have asked myself before asking the forum :)
I just installed the Frame Markers sample, and it worked perfectly well.
Crash on Kindle Fire HD
Actually, I spoke too soon.
Even after reducing the number of models to get rid of the out of memory crash, the Eclipse modified app still crashes on the Kindle - so the initial problem I posted about is still there.
Crash on Kindle Fire HD
The logs indicate a threading issue; basically the app is trying to modify the view hierarchy from the wrong thread;
my guess here is that the use of the TimerTask and Timer is causing the issue;
Crash on Kindle Fire HD
Implementing with postDelayed doesn't seem to make a difference, even with a delay of 10s.
Maybe it's my implementation.
I'm instatiating the handler in onCreate()
Crash on Kindle Fire HD
Ok, thanks for sharing the code; actually the problem is that you are using the Thread class:
Crash on Kindle Fire HD
Sorry I misinterpreted - I thought you meant remove the Timer stuff completely when implementing the Handler.
So now I have,
Crash on Kindle Fire HD
No, what I mean is:
- do not use the Thread class (and if you have now removed it, that's fine)
- use the Handler and remove the Timer / TimerTask
Crash on Kindle Fire HD
Ok, this time I think I got it.
Crash on Kindle Fire HD
Yes, the last implementation looks correct;
if you still see the issue, then there must be something else going wrong in the project; have you tried implementing the same technique starting from a fresh new Vuforia sample like ImageTargets or Frame Markers ?
Crash on Kindle Fire HD
I'll try that when I have some more free time. I'm just going to tell the client that the Kindle can't run this complex an AR app for the moment.
Crash on Kindle Fire HD
So, after all that, the problem was to do with Flurry.
I wasn't using the correct context to set up the session for that activity. Was using
instead of
Crash on Kindle Fire HD
Well, glad to see it is voled in the end.