2016-04-10 14 views
-1

當我嘗試在移動設備上運行我的應用我收到此錯誤:的Android的Java郎的NoClassDefFoundError Caldroid

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

有趣的是,當我運行模擬器上的應用程序,它的工作原理。

這裏,是我的build.gradle依賴關係:

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

回答

0

它看起來像我不得不multiDexEnabled中的build.gradle文件設置爲false。

multiDexEnabled false 
0

可能是編譯器或ProGuard問題。我假設您在設備上使用發佈版本,出於某種原因,編譯器或ProGuard認爲CalendarHelper類不是必需的(可能是由於使用了反射),並將其從發佈版本中除去。嘗試向ProGuard文件添加-keep指令。