我的应用程序无法构建,因为以下logcat错误,我甚至不理解

时间:2016-11-27 15:29:25

标签: android android-studio

这是logcat。我需要澄清这个错误,请社区

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: `com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: me`thod ID not in [0, 0xffff]: 65536

我做了更改,但我又得到了这个错误?

11-28 13:36:28.308 19872-19872/com.example.moses.nganya E/AndroidRuntime: FATAL EXCEPTION: main
                                                                          Process: com.example.moses.nganya, PID: 19872
                                                                          java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.moses.nganya/com.example.moses.nganya.MainActivity}: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
                                                                              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
                                                                              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442)

1 个答案:

答案 0 :(得分:0)

请参考this。原因是您已超出方法限制。这主要是由于使用google-play-services或任何其他大型库。如果使用google-play,请尝试仅使用必需的组件-services.List可以找到各个库here