【发布时间】:2016-05-04 15:16:12
【问题描述】:
我有这个问题几个小时,我没有解决。请帮帮我。
- 我已经做了清理/构建/重建/缓存无效/ Gradle 同步等。
- 最后,当我在警报对话框中有 onClick Listner 时,我得到了这个错误。
- 我正在调用一个按钮以显示来自片段的对话框,在该片段中我将上下文作为“getActivity”传递。但它适用于 Toast,所以 这不是问题(Toast 有效,Dialog 也适用于 ok 按钮 没有听众。)
:app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE :app:prepareComAndroidSupportDesign2220Library UP-TO-DATE :app:prepareComAndroidSupportMediarouterV72200Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE :app:prepareComCrashlyticsSdkAndroidAnswers132Library UP-TO-DATE :app:prepareComCrashlyticsSdkAndroidBeta113Library UP-TO-DATE :app:prepare ComCrashlyticsSdkAndroidCrashlytics252Library UP-TO-DATE :app:prepare ComCrashlyticsSdkAndroidCrashlyticsCore235Library UP-TO-DATE :app:prepare ComGithubLzyzsdCircleprogress110Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServices750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppstate750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesCast750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesFitness750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPanorama750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWearable750Library UP-TO-DATE :app:prepareComJourneyappsZxingAndroidEmbedded303Library UP-TO-DATE :app:prepare ComOguzdevCircularFloatingActionMenu102Library UP-TO-DATE :app:prepareComReginaldSwiperrefreshLibrary111Library UP-TO-DATE :app:prepareIoFabricSdkAndroidFabric136Library UP-TO-DATE :app:prepareRuNotiesScrollable113Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl 最新 :app:compileDebugRenderscript 最新 :app:generateDebugBuildConfig 最新 :app:generateDebugAssets 最新 :app:mergeDebugAssets 最新 :app:processDebugManifest 最新 :app:fabricGenerateResourcesDebug :app:generateDebugResValues 最新 :app:generateDebugResources :app:mergeDebugResources :app:processDebugResources :app:generateDebugSources :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl 最新 :app:processDebugAndroidTestManifest 最新 :app:compileDebugAndroidTestRenderscript UP-TO-DATE :app:generateDebugAndroidTestBuildConfig UP-TO-DATE :app:generateDebugAndroidTestAssets UP-TO-DATE :app:mergeDebugAndroidTestAssets 最新 :app:generateDebugAndroidTestResValues UP-TO-DATE :app:generateDebugAndroidTestResources UP-TO-DATE :app:mergeDebugAndroidTestResources 最新 :app:processDebugAndroidTestResources 最新 :app:generateDebugAndroidTestSources 最新 :app:processDebugJavaRes 最新 :app:compileDebugJava 注意:某些输入文件使用或覆盖已弃用的 API。 注意:使用 -Xlint:deprecation 重新编译以获取详细信息。 :app:compileDebugNdk 最新 :app:compileDebugSources :app:preDexDebug 最新 :app:dexDebug
意外的顶级异常: com.android.dex.DexIndexOverflowException:方法 ID 不在 [0, 0xffff] 中:65536 在 com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502) 在 com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277) 在 com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491) 在 com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168) 在 com.android.dx.merge.DexMerger.merge(DexMerger.java:189) 在 com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502) 在 com.android.dx.command.dexer.Main.runMonoDex(Main.java:334) 在 com.android.dx.command.dexer.Main.run(Main.java:277) 在 com.android.dx.command.dexer.Main.main(Main.java:245) 在 com.android.dx.command.Main.main(Main.java:106) 错误:任务“:app:dexDebug”执行失败。 com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_60\bin\java.exe'' 完成 非零退出值 2 信息:构建失败 信息:总时间:13.67 秒 信息:1个错误 信息:0 个警告 信息:在控制台中查看完整的输出 这是错误 这是我的对话框和 XML 按钮
按钮的 XML
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Rimuovi chiamata abbinata"
android:id="@+id/btn_del_chiamata"
android:layout_above="@+id/riep_tec_rl_nav"
android:layout_centerHorizontal="true"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:drawableRight="@drawable/delete"
android:background="@xml/edit_text" />
【问题讨论】:
-
你的问题是什么?它是崩溃还是不工作?
-
顶级异常:com.android.dex.DexIndexOverflowException
-
问题是多 dex 文件,要么你已经导入了两次库,要么超过了库限制!我可以看到你真的需要编译所有播放服务库吗?检查此链接以了解更多信息developers.google.com/android/guides/setup
标签: android