我怎样才能检查android中的dex数?

我项目的gradle文件如下.

android {
    compileSdkVersion 23
    buildToolsversion "25.0.1"

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt')
        }
    }
}

在Android Studio中“Generate Signed APK”时,我可以看到DexIndexOverflowException.

Error:Execution Failed for task ':MyProject:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: 
com.android.ide.common.process.ProcessException: 
java.util.concurrent.ExecutionException: 
com.android.dex.DexIndexOverflowException: method ID not in [0,0xffff]: 65536

我已经知道这个错误并阅读了文档(https://developer.android.com/studio/build/multidex.html).
我想查看已经超过了多少dex.

例如:

trouble writing output:
Too many field references: 99999; max is 65536.
You may try using --multi-dex option.

请找一个解决方案.
谢谢

最佳答案
使用此插件可在每次构建时获取APK中方法引用的数量.

dexcount

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...