Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi,
I'm trying to build an Android app that uses the ThingWorx Java SDK, but I'm encountering a runtime exception:
"java.lang.NoClassDefFoundError: com.thingworx.communications.client.ClientConfigurator"
The console also gives me a large number of warnings, of two kinds. I'm pasting one of each:
"Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(ch.qos.logback.classic.gaffer.ConfigurationDelegate$_copyContributions_closure2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is not an inner class."
"Dx bad class file magic (cafebabe) or version (0033.0000)
...while parsing com/thingworx/common/interfaces/IDataShapeDefinitionProvider.class
...while processing com/thingworx/common/interfaces/IDataShapeDefinitionProvider.class"
Does anyone know what causes this? I've tried using both Java 1.6 and 1.7 to compile the Android code.
Has anyone had any luck using the SDK with Android?
Hi David,
If you use the Java Edge SDK from the download page, it won't work for Android.
From my knowledge, the Edge JAVA SDK for Android apps is not yet released (it will be released, I just don't know when).
Vladimir
Hi All,
it's possible to use the JAVA SDK on an Android platform, as it's based on netty (which now supports Android).
a couple of things:
- you need to make sure that your application get the INTERNET persmissions.
- you need to enable specific Annotation processing (with ThingWorx libraries), therefore you cannot use the all-in-one ADT, but rather use your own version of Eclipse with the ADT manually installed.
- you might want to reference the latest version of netty for Android Compatibility.
B.
Ok, thanks.