Hi, If I'm not wrong Android uses a different implementation of the Java ServiceLoader, and that might be causing the issue. Could you try creating the context by directly passing an instance of the provider metadata? Something like:
ContextBuilder.newBuilder(new KeystoneApiMetadata()) ... This will bypass the ServiceLoader lookup and instantiate directly the context with the API you want to use. You may change the metadata class for whatever ApiMetadata or ProviderMetadata you want to use. Also, I'd recommend you configure the context to use the OkHttp driver [1], as it is an HTTP library specifically designed to work on Android devices. HTH! I. [1] https://github.com/jclouds/jclouds/tree/master/drivers/okhttp On 6 October 2014 16:55, azq <[email protected]> wrote: > Hi, everyone, > > My name is 安仲奇. > > I recently started using jclouds to develop clients for the internal > OpenStack platform of my lab, and jclouds really helped me a lot, and > everything worked fine in my Java Swing client. > > I ran into some problems when I tried to do the same on the Android > platform, such as: > > When building a Keystone API (`newBuilder("openstack-keystone")`), an > exception of > > ``` > java.util.NoSuchElementException: key [openstack-keystone] not in the > list of providers or apis: {} > ``` > > was throwed out. > > When getting the jclouds version (`JcloudsVersion.get()`), an exception > of > > ``` > java.lang.NullPointerException: > META-INF/maven/org.apache.jclouds/jclouds-core/pom.properties > ``` > > was catched. > > I'm using the `1.8.0-SNAPSHOT` jar files, and I've imported every > dependency jar downloaded by Maven to the `lib` folder of my Eclipse > projcet. > > So, any ideas about what could be the problem? Is jclouds compatible > with the Android platform? > > Best wishes! > > --- > > anzhongqi > High Performance Computer Research Center > Institute of Computing Technology, Chinese Academy of Sciences >
