title: NoClassDefFoundError: Failed resolution of: Lorg/apache/http/conn/ssl/DefaultHostnameVerifier;
body: <p>I'm trying to use <code>Exchange Web Services</code> <code>Java API</code> in a <code>Office365</code> <code>Android</code> app I'm making, but keep getting this error.</p>
  
  <p>Relevant stack information below:</p>
  
  <pre><code>Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/conn/ssl/DefaultHostnameVerifier;
          at microsoft.exchange.webservices.data.core.EwsSSLProtocolSocketFactory.&lt;clinit&gt;(EwsSSLProtocolSocketFactory.java:86)
          at microsoft.exchange.webservices.data.core.ExchangeServiceBase.createConnectionSocketFactoryRegistry(ExchangeServiceBase.java:212)
          at microsoft.exchange.webservices.data.core.ExchangeServiceBase.initializeHttpClient(ExchangeServiceBase.java:194)
          at microsoft.exchange.webservices.data.core.ExchangeServiceBase.&lt;init&gt;(ExchangeServiceBase.java:170)
          at microsoft.exchange.webservices.data.core.ExchangeService.&lt;init&gt;(ExchangeService.java:3779)
          at com.microsoft.office365.connect.SendMailActivity.onBookMeetingButton1(SendMailActivity.java:140)
  </code></pre>
  
  <p>...</p>
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.conn.ssl.DefaultHostnameVerifier" on path: DexPathList[[zip file "/data/app/com.microsoft.office365.connect-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
          at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
          at microsoft.exchange.webservices.data.core.EwsSSLProtocolSocketFactory.&lt;clinit&gt;(EwsSSLProtocolSocketFactory.java:86)
          at microsoft.exchange.webservices.data.core.ExchangeServiceBase.createConnectionSocketFactoryRegistry(ExchangeServiceBase.java:212)
          at microsoft.exchange.webservices.data.core.ExchangeServiceBase.initializeHttpClient(ExchangeServiceBase.java:194)
          at microsoft.exchange.webservices.data.core.ExchangeServiceBase.&lt;init&gt;(ExchangeServiceBase.java:170)
          at microsoft.exchange.webservices.data.core.ExchangeService.&lt;init&gt;(ExchangeService.java:3779)
          at com.microsoft.office365.connect.SendMailActivity.onBookMeetingButton1(SendMailActivity.java:140)
  </code></pre>
  
  <p>...</p>
  
  <pre><code>Suppressed: java.lang.ClassNotFoundException: org.apache.http.conn.ssl.DefaultHostnameVerifier
          at java.lang.Class.classForName(Native Method)
          at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
          at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
          ... 20 more
   Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
  </code></pre>
  
  <p>I have the httpclient 4.3.jar in my /libs/ folder and these are my dependencies:</p>
  
  <pre><code>dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:22.0.0'
  
  // base OData library:
  compile group: 'com.microsoft.services', name: 'odata-engine-core', version: '0.12.1'
  compile group: 'com.microsoft.services', name: 'odata-engine-android-impl', version: '0.12.1', ext:'aar'
  
  // choose the discovery and outlook services
  compile group: 'com.microsoft.services', name: 'discovery-services', version: '0.12.1'
  compile group: 'com.microsoft.services', name: 'outlook-services', version: '0.12.1'
  
  // Azure Active Directory Library
  compile group: 'com.microsoft.aad', name: 'adal', version: '1.1.1'
  
  //compile 'org.apache.httpcomponents:httpclient:4.4'
  //compile 'org.apache.httpcomponents:httpcore:4.3.3'
  //compile 'commons-logging:commons-logging:1.2'
  //compile 'joda-time:joda-time:2.7'
  }
  </code></pre>
  
  <p>Is anyone able to spot the issue or how I could possibly fix it?
  Thanks</p>