Thursday, June 23, 2011

Error: Unable to transcode assets/xyz.png

I got this error while trying to build a Flex application using Apache ant and Flex 4.5 SDK (Got it even while directly using the MXML command). The strange thing is that, I was able to successfully compile this same project at my office using the very same SDK. I googled and nowhere did I get a satisfactory solution. There were so many threads and links which showed a similar problem:

 Error: unable to resolve 'assets/xyz.png'.

The fact is that, the above error is entirely different from the error I am talking about. The above error is just because the compiler can't resolve the image. A '/' or  '../' before the 'assets' will easily solve the above problem.

But the error:

Error: Unable to transcode assets/xyz.png

is different and frustrating. I happens even though that particular image could be resolved. 

After a few hours of research I finally figured out the problem. The problem was with the underlying JDK.

My Machine is using 64 bit Windows 7, and apparently the JDK  was also a 64 bit. Flex release notes doesn't mention that it supports 64 bit os and now it's clear -It doesn't support. Finally after switching to a 32 bit JDK the project got compiled successfully.

Note- if the above solution doesn't work, you should try downloading the latest 32 bit JDK and try. 


No comments: