我已经在我的应用程序中集成了ZenDesk,但是当调用ContactZendeskActivity来创建故障单时,应用程序崩溃了。原木猫附在下面。请帮我。提前致谢
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':volley')
compile project(':ViewPagerIndicator')
compile project(':CircularImageView')
compile project(':CircularImageCropper')
compile project(':SwipeLayout')
compile project(':DragNDropLib')
compile group: 'com.zendesk', name: 'sdk', version: '1.5.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0'
compile 'jp.wasabeef:recyclerview-animators:2.0.1'
compile 'com.android.support:multidex:1.0.0'
compile 'javax.inject:javax.inject:1@jar'
compile 'com.squareup.dagger:dagger:1.2.2'
compile 'com.squareup.dagger:dagger-compiler:1.2.2'
compile 'junit:junit:4.12'
compile 'org.mockito:mockito-core:1.10.19'
}
致命的例外:主要 java.lang.NoClassDefFoundError:retrofit.Types at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:286) at retrofit.RestMethodInfo。(RestMethodInfo.java:97) at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213) at retrofit.RestAdapter $ RestHandler.invoke(RestAdapter.java:236) at $ Proxy1.getSettings(Native Method) 在com.zendesk.sdk.network.impl.ZendeskSdkSettingsService.getSettings(ZendeskSdkSettingsService.java:37) 在com.zendesk.sdk.network.impl.ZendeskSdkSettingsProvider.getSettings(ZendeskSdkSettingsProvider.java:57) 在com.zendesk.sdk.network.impl.ZendeskBaseProvider.getSdkSettings(ZendeskBaseProvider.java:92) 在com.zendesk.sdk.network.impl.ZendeskSettingsHelper.loadSetting(ZendeskSettingsHelper.java:28) 在com.zendesk.sdk.feedback.ui.ContactZendeskFragment.preloadSettingsAndInit(ContactZendeskFragment.java:237) 在com.zendesk.sdk.feedback.ui.ContactZendeskFragment.onCreateView(ContactZendeskFragment.java:223) 在android.support.v4.app.Fragment.performCreateView(Fragment.java:1962) 在android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) 在android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248) 在android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738) 在android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613) 在android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:330) 在android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:547) 在android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1188) 在android.app.Activity.performStart(Activity.java:5382) 在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2266) 在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) 在android.app.ActivityThread.access $ 700(ActivityThread.java:159) 在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1316) 在android.os.Handler.dispatchMessage(Handler.java:99) 在android.os.Looper.loop(Looper.java:176) 在android.app.ActivityThread.main(ActivityThread.java:5419) at java.lang.reflect.Method.invokeNative(Native Method) 在java.lang.reflect.Method.invoke(Method.java:525) 在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1046) 在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) 在dalvik.system.NativeStart.main(本地方法)
答案 0 :(得分:1)
通过添加MultiDex.install(this)修复了问题;在我的应用程序类中如下。在这种情况下无需添加改造依赖。
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}