-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'
}}
4

2 回答 2

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.

于 2016-04-10T22:44:43.443 回答
0

看起来我必须在 build.gradle 文件中将 multiDexEnabled 设置为 false。

multiDexEnabled false
于 2016-04-10T22:39:58.530 回答