Error found when using World Construction Kit ( WCK ) and Google Analytics

I am a big fan of the Box2D World Construction Kit and have used it to many build several games. However when working with the packages recently I encountered a strange problem when trying to incorporate Google Analytics into the build. I have used Google Analytics many times in the past, so I was surprised to find an error when using it. I had opted to use the Analytics component and avoid using the AnalyticsLibrary component. I spent a while trying to figure out if there was a problem in my code, but there really is not much you can get wrong with Google Analytics and this was not the case. Here is the error I was receiving:

outer-scope = [global Object$$ flash.display::DisplayObject$ flash.display::InteractiveObject$ flash.display::DisplayObjectContainer$ flash.display::Sprite$ flash.display::MovieClip$ Preload$]
[Preload~[O] *[A]] {} ()
[Preload~[O] *[A]] {} (Preload~[O])
[Preload~[O] *[A]] {Preload~[O]} ()
[Preload~[O] *[A]] {Preload~[O]} (Object~[A])
[Preload~[O] *[A]] {Preload~[O]} (Object~[A] Preload~[O])
5:pushstring “UA-19243777-5”
[Preload~[O] *[A]] {Preload~[O]} (Object~[A] Preload~[O] String~[S])
7:pushstring “AS3”
[Preload~[O] *[A]] {Preload~[O]} (Object~[A] Preload~[O] String~[S] String~[S])
9:constructprop 11 3
[Preload~[O] *[A]] {Preload~[O]} (*[A])

VerifyError: Error #1014: Class could not be found.

at Preload/handleComplete()

To this day I am unsure why the class can not be found when trying to use Google Analytics with Box2D World Construction Kit. It is really strange, I can trace everything as expected but it still errors. The workaround we came up with was to install the Google AnalyticsLibrary component into Flash. For some reason this solved my issue, and I was able to compile after doing this even though I didn’t adjust any of my code.

If anyone could unravel this further then leave a comment! I am intrigued to find out the real reason behind this. For the mean time, if anyone else encounters this bug then placing the LibraryComponent into the library may help you.

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditShare on StumbleUponShare on TumblrEmail this to someone

Leave a Reply

Your email address will not be published.