1. Download our Official Android App: Forums for Android!

Apps EWS-JAVA-API: java.lang.VerifyError: microsoft/exchange/webservices/data/ExchangeServiceBase

Discussion in 'Android Development' started by Noman Ud Din, Apr 30, 2016.

  1. Noman Ud Din

    Noman Ud Din Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    4
    Joined:
    Oct 9, 2015

    Oct 9, 2015
    4
    0
    5
    Male
    I know this question has been asked several time but not a single solution worked for me. I spent almost three days on all the available solutions

    I am using android studio.

    I have used code and libraries provided on this link: Github link for ews project

    But I am facing following error:

    Code (Java):
    1. java.lang.VerifyError: microsoft/exchange/webservices/data/ExchangeServiceBase
    2.                                                                  at culha.roomdispaly.MainActivity.onCreate(MainActivity.java:125)
    3.                                                                  at android.app.Activity.performCreate(Activity.java:5411)
    4.                                                                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
    5.                                                                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
    6.                                                                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2396)
    7.                                                                  at android.app.ActivityThread.access$800(ActivityThread.java:139)
    8.                                                                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
    9.                                                                  at android.os.Handler.dispatchMessage(Handler.java:102)
    10.                                                                  at android.os.Looper.loop(Looper.java:149)
    11.                                                                  at android.app.ActivityThread.main(ActivityThread.java:5257)
    12.                                                                  at java.lang.reflect.Method.invokeNative(Native Method)
    13.                                                                  at java.lang.reflect.Method.invoke(Method.java:515)
    14.                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    15.                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
    16.                                                                  at dalvik.system.NativeStart.main(Native Method)

    My Build.gradle file:


    Code (Java):
    1. apply plugin: 'com.android.application'
    2.  
    3. android {
    4. compileSdkVersion 23
    5. buildToolsVersion "23.0.2"
    6. useLibrary 'org.apache.http.legacy'
    7.  
    8. packagingOptions  {
    9.     exclude 'META-INF/DEPENDENCIES.txt'
    10.     exclude 'META-INF/LICENSE.txt'
    11.     exclude 'META-INF/NOTICE.txt'
    12.     exclude 'META-INF/NOTICE'
    13.     exclude 'META-INF/LICENSE'
    14.     exclude 'META-INF/DEPENDENCIES'
    15.     exclude 'META-INF/notice.txt'
    16.     exclude 'META-INF/license.txt'
    17.     exclude 'META-INF/dependencies.txt'
    18.     exclude 'META-INF/LGPL2.1'}
    19.  
    20. defaultConfig {
    21.     applicationId "culha.roomdispaly"
    22.     minSdkVersion 19
    23.     targetSdkVersion 23
    24.     versionCode 1
    25.     versionName "1.0"
    26. }
    27.     buildTypes {
    28.         release {
    29.             minifyEnabled false
    30.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    31.             zipAlignEnabled true
    32.         }
    33.     }
    34. }
    35.  
    36. dependencies {
    37. compile fileTree(dir: 'libs', include: ['*.jar'])
    38. testCompile 'junit:junit:4.12'
    39. compile 'com.android.support:appcompat-v7:23.1.1'
    40. compile 'com.android.support:design:23.1.1'
    41. compile files('libs/commons-lang-2.6.jar')
    42. compile files('libs/commons-logging-1.1.1.jar')
    43. compile files('libs/ical4j-1.0.3.jar')
    44. compile files('libs/backport-util-concurrent.jar')
    45. compile 'com.google.android.gms:play-services-appindexing:8.1.0'
    46. compile files('libs/ews-java-api-2.0.jar')
    47. compile files('libs/jcifs-1.3.15.jar')}
    48. }
    My code where I am calling ews:
    Code (Java):
    1.  try {
    2.             ExchangeService service = new ExchangeService();
    3.             ExchangeCredentials credentials = new WebCredentials("xxxxx", "xxxx");
    4.             service.setCredentials(credentials);
    5.             service.setUrl(new URI("https://xxx.xxx.comxxxx"));
    6.             FolderView view = new FolderView(10);
    7.             PropertySet set = new PropertySet(BasePropertySet.IdOnly);
    8.             set.add(FolderSchema.DisplayName);
    9.             view.setPropertySet(set);
    10.             SearchFilter searchFilter = new SearchFilter.IsGreaterThan(FolderSchema.TotalCount, 0);
    11.             view.setTraversal(FolderTraversal.Deep);
    12.             FindFoldersResults findFolderResults = service.findFolders(WellKnownFolderName.Root, searchFilter, view);
    13.             for (Folder folder : findFolderResults)
    14.             { if (folder instanceof CalendarFolder)
    15.             { System.out.println("Calendar folder: " + folder.getDisplayName());
    16.                 //calendarNames.add(folder.getDisplayName() + "," + folder.getId());
    17.             }
    18.             }
    19.             //ewstest.connectViaExchangeManually("Meetingroom1@culha-consulting.de","Meeting1234");
    20.             //ExchangeWebservice.connectViaExchangeManually("Meetingroom1@culha-consulting.de","Meeting1234");
    21.         } catch (Exception e) {
    22.             e.printStackTrace();
    23.         }
     

    Advertisement

Share This Page

Loading...