cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Problem using ThingWorx Java SDK with Android

davidhol
1-Newbie

Problem using ThingWorx Java SDK with Android

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?

3 REPLIES 3

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.

Top Tags