我能够正确构建应用程序,但是当我运行它时,我收到此错误:
This version of android studio is incompatible with the gradle version used.Try disabling the instant run
Run Code Online (Sandbox Code Playgroud) 在构建时在Android studio canary 3.0预览中获取此错误.
我在自定义库中包含了改造,我在 com.mmt.commoncore.rssupport.modules.AppModule.provideRetrofit(AppModule.java:97) at com.mmt.commoncore.rssupport.modules.AppModule_ProvideRetrofitFactory.get(AppModule_ProvideRetrofitFactory.get(AppModule_ProvideRetrofitFactory. java:27) 在 com.mmt.commoncore.rssupport.modules.AppModule_ProvideRetrofitFactory.get(AppModule_ProvideRetrofitFactory.java:10) 在 dagger.internal.ScopedProvider.get(ScopedProvider.java:46) 在 com.mmt.commoncore.rssupport.modules .AppModule_ProvideYipstayApiInterfaceFactory。get(AppModule_ProvideYipstayApiInterfaceFactory.java:23) at com.mmt.commoncore.rssupport.modules.AppModule_ProvideYipstayApiInterfaceFactory.get(AppModule_ProvideYipstayApiInterfaceFactory.java:9) at dagger.internal.ScopedProvider.common.get(6mmtProvider.common) .notificationModule.gcm.GCMRegistrationService_MembersInjector.injectMembers(GCMRegistrationService_MembersInjector.java:27) 在 com.mmt.commoncore.notificationModule.gcm.GCMRegistrationService_MembersInjector.injectMembers(GCMRegistrationService_MembersInjector.java:27)9) 在 com.mmt.commoncore.rssupport.components.DaggerRsComponent.inject(DaggerRsComponent.java:76) 在 com.mmt.commoncore.notificationModule.gcm.GCMRegistrationService.onHandleIntent(GCMRegistrationService.java:46) 在 android.app.IntentService $ServiceHandler.handleMessage(IntentService.java:65) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android。os.HandlerThread.run(HandlerThread.java:61) 引起:java.lang.ClassNotFoundException:在路径上没有找到类“retrofit2.GsonConverterFactory”:DexPathList[[dex file”/data/data/com.mmt.rightstay_host /files/instant-run/dex/slice-uk.co.chrisjenx-calligraphy-2.1.0_3d857cf3e39e24fe75c5e1fc0649101f8c786b4b-classes.dex”,dex文件“/data/data/com.mmt/fileruns/dexinstay/com.host/fileruns/dexinstay slice-support-annotations-23.2.0_368c85ce5b387877b354d725ac6f688f6bf6140f-classes.dex", dex 文件 "/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-stetho.dex25091bc5070595c5095c5095c5095c5095c5095c507050915c505c507050915c50705c85c50705075c85c502015070507018200f-classes.dex", dex 文件"/data/data/com.mmt.rightstay_host ", dex 文件 "/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-stetho-1.3.1_f60927bf861572c3ecd9ae19dfc0eb4820e4ba72-classes.dex", dex 文件"/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-sqlite-annotations-1.8.0_1580dex70d300_1580dex702d3fc080200000000000000c数据/com.mmt.rightstay_host/files/instant-run/dex/slice-sqlite-1.8.0_bbbd74ff221b96cc900c974ea9131a52d563d2f2-classes.dex", dex文件"/data/data/com.mmt.rightstay_run /slice-slice_9-classes.dex", dex 文件 "/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-slice_8-classes.dex", dex 文件 "/data/data/com .mmt.rightstay_host/files/instant-run/dex/slice-slice_7-classes.dex”,dex 文件“/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-slice_6-classes。 dex", dex 文件 "/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-slice_5-classes.dex", dex 文件 "/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-slice_4-classes.dex", dex 文件“/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-slice_3-classes.dex”,dex 文件“/data/data/com.mmt.rightstay_host/files/instant-run /dex/slice-slice_2-classes.dex”,dex文件“/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-slice_1-classes.dex”,dex文件“/data/data /com.mmt.rightstay_host/files/instant-run/dex/slice-slice_0-classes.dex", dex 文件 "/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-rxjava- 1.1.1_ce6be595c06b6845e7802dcf578b87593d3c6f26-classes.dex”,dex文件“/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-retrofit-2.0.0_8ef69f394c73c1478d01ea2227c2299c0aa5302f-classes.dex", dex 文件 "/data/data/com.mmt.rightstay_host/files/instant-run/dex/slice-replaying-share-1.0.0381816e7ae-replaying-share-1.0.0_81816dexe-aaa5302f-classes.dex", dex 文件"
我HandlerInterceptor在Spring Boot中使用它来处理常见的请求类型.但是在执行时preHandle,如果不满足条件,我想将错误状态代码返回给用户.如果我preHandle在响应中抛出异常将具有所有异常堆栈.如何使用preHandle的响应代码发送自定义正文作为响应