繁体   English   中英

android gms大方法计数。 如何避免呢?

[英]android gms big method count. How to avoid it?

我愿意-与许多开发人员一样,臭名昭著的android 65000方法限制也有问题。 我已经在对我的应用程序进行了多种处理,但是我真的想以某种方式使其更轻巧。

这是我的应用程序方法的图表(与dexcount插件一起使用: https : //github.com/KeepSafe/dexcount-gradle-plugin )。

在此处输入图片说明

如您所见,大多数方法都来自com.google.android.gms包。 这是来自build.gradle文件的依赖项列表:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    compile project(':libs:cip-library:cip-library')
    compile project(':libs:android-times-square')
    compile files('../libs/mobile.connect-android-1.7.6.jar')
    compile files('../libs/dtapl-2.1.1.jar')
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:cardview-v7:24.2.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
    compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.google.code.gson:gson:2.4'
    compile 'de.greenrobot:greendao:2.0.0'
    compile 'com.pnikosis:materialish-progress:1.5'
    compile 'org.adw.library:discrete-seekbar:1.0.0'
    compile 'com.android.support:design:24.2.1'
    compile 'net.fredericosilva:showTipsView:1.0.4'
    compile 'com.google.maps.android:android-maps-utils:0.4.4'
    compile 'com.robohorse.gpversionchecker:gpversionchecker:1.0.8'
    compile 'net.danlew:android.joda:2.9.4.1'
    compile 'com.android.support:support-annotations:24.2.1'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
        transitive = true;
    }
    compile('com.mikepenz:aboutlibraries:5.7.1@aar') {
        transitive = true
    }
}

现在,我知道这些依赖并不是很多,但是我不明白的是,具体是哪个(以及如何)触发对com.google.android.gms.internal.games之类的程序包的依赖,而我的应用程序并非如此游戏com.google.android.gms.internal.cast或com.google.android.gms.internal.fitness。 而且-最重要的是-我怎么能摆脱那些依赖关系?

非常感谢Marco

要了解某些依赖项的来源,请在应用程序的模块上运行dependencies Gradle任务。 假设您应用的模块名为app ,则命令如下所示:

./gradlew -q :app:dependencies

输出应该包含所有传递依赖项,并且应该很容易看出哪些库正在拖动要摆脱的内容。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM