-1

I am getting this error when I try to run my app on the mobile device:

java.lang.NoClassDefFoundError: com.roomorama.caldroid.CalendarHelper
at com.roomorama.caldroid.CaldroidFragment.retrieveInitialArgs(CaldroidFragment.java:1087)...

It's interesting that when I run the app on the emulator, it works.

Here-s my build.gradle dependencies:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.roomorama:caldroid:3.0.1'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'com.google.android.gms:play-services-base:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.android.support:support-v4:23.1.1'
compile('com.google.api-client:google-api-client-android:1.20.0') {
    exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-calendar:v3-rev125-1.20.0') {
    exclude group: 'org.apache.httpcomponents'
}}
Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141

2 Answers2

0

It looks like I had to set multiDexEnabled to false in the build.gradle file.

multiDexEnabled false
0

Possibly a Compiler or ProGuard issue. I would assume you are using a release version on the device, and for some reason the compiler or ProGuard thinks that the CalendarHelper class is not needed (possibly due to use of reflection), and strips it out of release version. Try adding a -keep directive to ProGuard file.

lionscribe
  • 3,413
  • 1
  • 16
  • 21