STOP PRESS: Just found this after writing the text below:

http://stackoverflow.com/questions/5760607/using-serviceloader-on-android

Looks like apk's don't easily support the ServiceLoader pattern...

I'm trying to use the jar files in an Android app and I get the above
exception. I have a normal java app that works with jclouds, but for some
reason I can't get them to work in Android. Here is the list of
dependencies I'm using:

Ah, it's on Android (I recall this list - I think I mentioned the mix of versions already ;-)). The mix of versions certainly won't help, although I remember you said things didn't work otherwise. Can you see which, if any,

META-INF/services/org.jclouds.providers.ProviderMetadata

files you have on the classpath of the actual compiled binary? If the Android packaging (and I'm not the Android expert, so apologies if this doesn't make sense) does something like merging all the jclouds JARs into something like an uberjar, these files will need to be merged.

As a debugging aid, you can explicitly try to load all resources of that name you can find on your app's classpath [1] and print their contents. If you can't find any such classpath resources, that will be why we see this problem.

ap

[1] http://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#getResources(java.lang.String)

Reply via email to