Google TV app with external libraries (jar)

453 Views Asked by At

I am trying to run a simple app on the Google TV emulator.

The app has a jar, it is both in the build path and in the lib folder, it works on ICS and on Honeycomb 3.1 (tablet) but on the Google TV emulator, it crashes:

D/dalvikvm( 1707): DexOpt: 'Ljavax/jmdns/ServiceListener;' has an earlier definition; blocking out

As if the lib had already been loaded.

Anyone seen this before?

Thanks

2

There are 2 best solutions below

0
On BEST ANSWER

Yes, I have seen this before. Google TV is using JMDNS for supporting software remote controls. When I included JMDNS in my own app it was always loading the classes from the version already installed on the device instead of my copy of the classes. I did all of my testing on a Google TV device and didn't use the emulator. The JMDNS version on Google TV also appears to be older than the latest version of JMDNS. In my code I called newer functions that failed on the device even though my copy of the JMDNS jar had those newer function signatures. It looks like the class loader on Android/Google TV is always picking up the system jar files before it gets to each app's jar files.

1
On

Thanks, this post helped me make progress on a GTV project I am working on that uses jmDNS. I needed jmDNS to discover printers on the network and found out that the version of jmDNS that is built into GTV (version 2.1) does not discover printers. I took the latest jmDNS version (at the time v3.4.1), changed the namespace names, recompiled into my code and ran my app on GTV. Printer discovery now works great. Of course, I can't ship my app with the altered version of jmDNS due to Apache licensing terms. But, until the GTV code is updated to include a newer version of jmDNS, changing the namespace names in the jmDNS source code will allow you to develop your printer discovery app.