检查你在 Android Studio 中有多少方法 [英] Check how many methods you have in Android Studio

查看:25
本文介绍了检查你在 Android Studio 中有多少方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来我对 65K 的 dex 限制很感兴趣,如果我写一些新的方法我有一个 dex 错误,如果我删除一些旧的东西,它就消失了.

有没有办法检查您目前在 Android Studio 中使用了多少方法?

解决方案

Android Studio 提供了一种内置方式来执行此操作.切换到项目"视图,导航到/app/build/outputs/apk/flavor/type apk 的路径.双击 APK.这将在编辑器中启动 apk,您可以在其中在窗口的上半部分看到各种库及其相关大小.在这个窗口中向下滚动,直到找到 classes.dex(或者如果你有多个,classes2.dex 等).单击此按钮,您将在窗口底部看到按包的方法引用.如果您使用多种风格或构建类型,您还可以使用此视图来分析构建的 Android Manifest.可以在

It looks like I'm flirting with the dex limit of 65K, if I write some new methods I have a dex error, if I remove some older things, it's gone.

Is there a way to check how many methods you are using at the moment in Android Studio?

解决方案

Android Studio provides a built in way to do this. Change to the 'Project' view, navigate to /app/build/outputs/apk/path to flavor/type apk. Double click on the APK. This will launch the apk in the editor where you can see the various libraries and their associated sizes in the top half of the window. Scroll down in this window until you find classes.dex (or if you have more than one, classes2.dex, etc.). Click on this and in the bottom of the window you will see method references by package. You can also use this view to analyse the constructed Android Manifest if you work with multiple flavors or build types. More info can be found on the android developer site

这篇关于检查你在 Android Studio 中有多少方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆